A fast code generator CLI tool
Project description
CLI utility for code generation based on a TOML configuration file.
Installation
pip install gadcodegenerator
Usage
gadcodegenerator --file {config.toml} --context "{}"
General Structure
workdir = "myproject"
folders = []
exclude = []
[[files]]
path = "{{name}}.py"
content = """
def hello():
print("Hello", {{name}})
if __name__ == '__main__':
hello()
"""
[[scripts]]
command = "isort {{workdir}}"
check = true
Sections Overview
| Section | Format | Description | ||
|---|---|---|---|---|
workdir |
"" |
Uses the current directory | ||
"myproject" |
Uses the current directory + /myproject |
|||
"/home/myproject" |
Uses an absolute path | |||
exclude |
["src/static/__init__.py"] |
Uses a relative path to workdir. Excludes file creation. |
||
folders |
["src/", "src/static"] |
Uses a relative path to workdir. Describes directories to be created. |
||
[[files]] |
Defines file creation rules | |||
mode = "a" |
File writing mode: "a" (append), "w" (overwrite) |
|||
path = "src/__init__.py" |
Relative to workdir, specifies file location. | |||
""" ... """ / path / url |
Raw content, local file path, or URL for remote content. | |||
[[scripts]] |
Defines commands to be executed after generation. | |||
command = "isort {{workdir}}" |
Command to execute, supports dynamic variables. | |||
check = True\False" |
If true, raises an error if the command fails, otherwise logs output. |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gadcodegenerator-0.0.1.tar.gz.
File metadata
- Download URL: gadcodegenerator-0.0.1.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a91c702b10ada819effaf7dfc3f8bc4720b9a8f3df274bfdc467661f9d5f9ba6
|
|
| MD5 |
8992322fca290f0c93df5a2733187cb3
|
|
| BLAKE2b-256 |
ca2f8567e9d27a3f6f578833f1eadea0cf3ff8d1030547219cd25e44a1959b77
|
File details
Details for the file gadcodegenerator-0.0.1-py3-none-any.whl.
File metadata
- Download URL: gadcodegenerator-0.0.1-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2840f1051fd622f6b77604e3204ac9359409541441abc5264a8556d3e3de1f9f
|
|
| MD5 |
294ef12bb927fa8aab5e6d07eaf01a4a
|
|
| BLAKE2b-256 |
506619c2ec291af573507c6cbfda49de96ef37ca5584c0827ad34c12433b629e
|