Build a fully featured CLI for your python project with minium effort
Project description
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'>
With easy cli execution and type coercion like this:
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.1.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for clifunction-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51619a1c047ebf3d4a7d948690a034cc781bf08a6806411902bcaf63e5e85261 |
|
MD5 | 4819ab12929473359490139d49e751db |
|
BLAKE2b-256 | 7897726a5ee5b2c70a694170689c87e9e8cbac3699bdec4ee429ff91d60afb52 |