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.

Source Distribution

clizy-1.0.1.zip (9.3 kB view details)

Uploaded Source

File details

Details for the file clizy-1.0.1.zip.

File metadata

  • Download URL: clizy-1.0.1.zip
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for clizy-1.0.1.zip
Algorithm Hash digest
SHA256 cd16ff9345bedad4204c07933c50fc516c9246a9b777c8cb082d27c2d1cad7d4
MD5 9458d76a79aa809a9958c98208273435
BLAKE2b-256 a10fda156b383b4e3820dcb67f9c3e0de76cace1a526a59db2c2a54278f3b9f2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page