Reference: App Directory Structure
Overview
The following is an example of the directory structure of an App sourced from a template using the tcex init command.
├── .gitignore
├── .pre-commit-config.yaml
├── README.md
├── app.py
├── app_lib.py
├── args.py
├── install.json
├── log
│ ├── app.log
│ ├── message.tc
│ ├── run.log
├── playbook_app.py
├── pyproject.toml
├── requirements.txt
├── run.py
├── setup.cfg
└── tcex.json.gitignore
This template file is optional but recommended when using Git™ version control. The file specifies intentionally untracked files that Git will ignore. This file can be removed or updated without issue. The update option on the tcex init command will optionally replace this file with the latest template, if prompted.
.pre-commit-config.yaml (optional)
This configuration file is for the pre-commit Python® command-line interface (CLI) tool. In order for this file to be used, some configuration is required. Please reference the setup instructions provided on the tool website for assistance.
This configuration is the same one that is used for Apps developed by the ThreatConnect Integrations team.
README.md (required)
The README.md file should contain any relevant information for the App and the App release notes. The contents of this file are displayed when updating an App in the ThreatConnect platform.
app.py (required)
This file contains the “main” App logic for all App types. There are several template files that provide basic examples of different categories of Apps with working code included.
arg.py (required)
This file contains the args required for the App to function properly. Only App args are required to be defined. The default args are part of the TcEx framework and are added automatically.
install.json (required)
This is the main configuration file for the App and controls what inputs and outputs will be presented to the user.
SEE ALSO
log (temporary)
This directory is created when running a testing profile locally. All App logging output is written to this directory, as well as the output from the test cases.
log/app.log (temporary)
This log file contains the logging output of the App.
log/message.tc (temporary)
This file contains the App exit message. When running the App in the ThreatConnect platform, the contents of this file will be displayed in the UI. For local testing, the file should be verified to have the appropriate content on App completion.
xxx_app.py (required)
This template file contains the parent Class for app.py, including base logic for an App. This file should not be edited and will be updated when using the tcex update command.
- api_service_app.py - Base file for API Service Apps.
- external_app.py - Base file for External Apps.
- job_app.py - Base file for Job Apps.
- playbook_app.py - Base file for Playbook Apps.
- service_app.py - Base file for TriggerService and WebhookTrigger Service Apps.
pyproject.toml (optional)
This is a Python tool configuration file used to for multiple linting and formatting tools in the project. It can be using in conjunction with pre-commit or with individual tools.
requirements.txt (required)
This file contains all required Python dependencies for the App. The requirements.txt file is used by the tcex deps command to build the lib_x.x.x directories.
run.py (required)
This template file is called by ThreatConnect to launch the App. This file should not be edited and will get updated when using the tcex update command. This file is unique per template type being used for the base project.
setup.cfg (optional)
This file contains Python configurations data, specifically for linting ignores or excludes.
tcex.json (required)
This is the main TcEx framework configuration file. It is required to run local testing and for packaging, but it should not be included in the App package.
Git™ is a trademark of Software Freedom Conservancy, Inc.
Python® is a registered trademark of the Python Software Foundation.
Updated 12 months ago