Skip to main content

Command-line generator from a dictionary.

Project description

This module is a wrapper to argparse module. Its goal is to generate a custom and advanced command-line from a formatted dictionary. The sequence of subparsers is not limited but it is not possible to have a (sub)parser that have both subparsers and options. The idea is really to not write dozens or hundreds of lines of code to generate the command-line but to outsource it to a file in a “classic” format (YAML, JSON, …).

Code is available on Github (http://github.com/fmenabe/python-clg).

Documentation is available on readthedocs (https://clg.readthedocs.org/en/latest/).

Releases notes

0.5

  • Port code to Python 3 (with compatiblity at least until Python 2.6)

0.4

  • Add description of parser (via desc keyword).

0.3

  • Add an iterable and accessible namespace for arguments.

  • Change behaviour of parse method (now return a namespace with arguments).

  • Set default value for list type to empty list.

  • Change behaviour of the execution of an external module. It is no longer a python path of a module in ‘sys.path’ but directly the path of a file. In addition, keyword ‘lib’ has be replaced by ‘path’.

  • Replace ‘__FILE__’ in default value of an option by the directory of the program.

  • Update the licence to MIT.

0.2

  • CommandLine object doesn’t take anymore a JSON or YAML file but a dictionary.

  • Add documentation.

  • Updating setup for PyPi.

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

clg-0.5.tar.gz (6.0 kB view details)

Uploaded Source

File details

Details for the file clg-0.5.tar.gz.

File metadata

  • Download URL: clg-0.5.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for clg-0.5.tar.gz
Algorithm Hash digest
SHA256 e438269a2a43657de98037fdff2c4ce9590fe972abcee9eeca85f322a6fcd780
MD5 f929972578284a8d0f74811aa06ad2b9
BLAKE2b-256 9c4c54e1c540ce0d152d7e2a02cae72b4102067f51a36f05031b823be6544df1

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