config-argument-parser#

PyPI Codacy Badge codecov

A package to help automatically create command-line interface from configuration or code.

It contains three modules CAP🧢(ConfigArgumentParser), TAP🚰(TypeArgumentParser), and GAP🕳️(GlobalArgumentParser).

Read the documentation here.

Motivation#

Configuration files are highly readable and useful for specifying options, but sometimes they are not convenient as command-line interface. However, it requires writing a lot of code to produce a CLI. This package automates the building process, by utilizing the Python standard libraries configparser and argparse.

The design is to minimize the changes to your original scripts, so as to facilitate maintenance.

Features#

  • Only few extra lines are needed to build a CLI from an existing script.

  • The comments are parsed as help messages. (Most libraries do not preserve the comments.)

  • Consistent format between configuration and script provides ease of use.