Overview¶
arc is a tool for building declarative, and highly extendable CLI applications for Python ^3.10.
Features¶
arc's features include:
- Command line Arguments, Options, and Flags - Using Python function arguments
- Data Validation - Via Python type hints
- Subcommands - For breaking functionality of your CLI into discrete components
- Documentation - Automatic
--help
generation from your command definitons - Developer Extension - Middleware for extending the functionality of your CLI
- User Extension - Plugin support for extending the functionality of your CLI
Installation¶
arc can be installed with pip
Example¶
To start off, here's a simple example application that can be used to greet someone
examples/hello.py
import arc
@arc.command
def hello(name: str):
"""Greets someone by name"""
arc.print(f"Hello {name}!")
hello()
Tip
The above example, and all examples in this documentation are complete and should run as-is. Additionally all examples are available in the source repo
Automatic Documentation¶
And a quick demonstration of the documention generation:
$ python hello.py --help
USAGE
hello.py [-h] name
DESCRIPTION
Greets someone by name
ARGUMENTS
name
OPTIONS
--help (-h) Displays this help message
Check out the Usage section for more information on how to use arc.
Playground¶
You can check out the playground to try out arc in your browser.