Python Builder
The Python builder is maintained by the authors of Brandon and provides a basic CLI Python boilerplate. The project can also be extended to serve a REST API or a library.
Project Structure
Below is the project structure generated by this builder. Command groups will have separate files for themselves under the cli
directory, and are imported by the main
module. Dependencies are specified in the pyproject.toml
file, together with the name of the executable to be installed and other metadata.
{app}-{version}
├── {app}
│ ├── cli
│ │ ├── {group1}.py
| | ├── {group2}.py
│ │ └── __init__.py
│ ├── __init__.py
│ ├── main.py
│ └── schemas.py
├── pyproject.toml
├── README.md
└── tests
Dependencies
The command line parser library used in this builder is Click, which is currently set to version 8.1
.
The packaging and dependency management is done using Poetry.
Naming Conventions
The following naming conventions were used when generating the stub. Characters that don't comply with the naming convention will be removed when reading the specification file.
Type | Case | Format | Spec Example | Code Example |
---|---|---|---|---|
App name and executable | Lower | [A-Za-z0-9-_] |
My-App |
My-App |
Classes | Title | [A-Za-z0-9] |
output-formats |
OutputFormats |
Enum Keys | Upper | [A-Z0-9_] |
key-1 |
KEY_1 |
Methods, Functions | Snake | [a-z0-9_] |
my-command |
my_command |
Parameters | Snake | [a-z0-9_] |
my-argument |
my_argument |