Simple subcommand CLIs with argparse
Project description
multicommand
Simple subcommand CLIs with argparse.
Installation
pip install multicommand
Overview
multicommand
enables you to easily write CLIs with deeply nested commands using vanilla argparse.
Just create a directory structure that reflects the command structure you want, add a parser to each module (don't worry about hooking them up!), and multicommand will do the rest.
multicommand turns a directory structure like this:
commands/unary/negate.py
commands/binary/add.py
commands/binary/divide.py
commands/binary/multiply.py
commands/binary/subtract.py
Into a command line application like this:
mycli unary negate ...
mycli binary add ...
mycli binary divide ...
mycli binary multiply ...
mycli binary subtract ...
All multicommand needs is for each module to define a module-level parser
variable which points to an instance of argparse.ArgumentParser
.
Getting Started
See the simple example.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
multicommand-0.0.6.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for multicommand-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af1af040f78aab49e84dedc75737edab6b5cef7de6bc753d026d7ec380505692 |
|
MD5 | cf9a8715e6ede5481e755cc47435b549 |
|
BLAKE2b-256 | 9ff8bda2fab5c34f434b8ac4d68665a98e080335d0c07cd5b9ed467ec2df3fa7 |