Build a fully featured CLI for your python project with minium effort
Project description
DecoratorCLI
Enables you to build a CLI with python in the most straightforward way with the fewest lines of code:
turn this:
from CliFunction import cli_function, cli
@cli_function
def migrate_data_base(*, start_version: int = 0, end_version: int = 3):
"""
Runs DB migrations.
"""
print(f"Migrating DB from {start_version} to {end_version}")
if __name__ == "__main__":
CliFunction.cli()
into a CLI with documentation like this:
C:\Users\isaak\dev\clifunction>python Example.py
Targets
migrate_data_base -- Runs DB migrations.
start_version | default:0 | type:<class 'int'>
end_version | default:3 | type:<class 'int'>
That can execute your functions via the CLI including type coercion
C:\Users\isaak\dev\clifunction>python Example.py mdb -sv=1 -ev=2
migrate_data_base: {'start_version': 1, 'end_version': 2}
Migrating DB from 1 to 2
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
clifunction-0.2.0.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for clifunction-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4a811f5366c7d85b3aab6094bec99bb9be085692abe2fb189dab5f88d6df122 |
|
MD5 | 17ea25249abb6fba1d28e8620fb06394 |
|
BLAKE2b-256 | 0ff37b25932f77d457d251bfb02fbeeb08b17576d91b2c224e081c9272181512 |