config-argument-parser
A package help automatically create command-line interface from configuration or code.
It contains two modules CAP🧢(ConfigArgumentParser
) and TAP🚰(TypeArgumentParser
).
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 a 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.