Skip to main content

Command-line interface creation for lazy people using type hints.

Project description

clizy

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
clizy-1.0.1.zip (9.3 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page