Command-line interface creation for lazy people using type hints.
Project description
Command-line interface creation for lazy people using type hints.
Quickstart
This code snippet:
# ls.py
def ls(filename, *, long=False, all=False, human_readable=False, limit: int=None):
"""
Fake command for listing.
:param filename: filename, what else did you expect?
:param long: long listing or something
:param all: all, like including hidden files dude
:param human_readable: show human readable stats
:param limit: limit the number of files printed
"""
...
generates this command line interface:
$ python ls.py --help
usage: ls [-h] [-l] [-a] [-H] [-L LIMIT] filename
Fake command for listing.
positional arguments:
filename filename, what else did you expect?
optional arguments:
-h, --help show this help message and exit
-l, --long long listing or something
-a, --all all, like including hidden files dude
-H, --human-readable show human readable stats
-L LIMIT, --limit LIMIT
limit the number of files printed
Clizy simplifies command line interface creation by using things we all use, know and love - arguments names, default values, docstrings and type hints - without unnecessary complexities and overwhelming documentation.
Interested? See docs and comparison with other libraries.
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
clizy-1.0.1.zip
(9.3 kB
view hashes)