Create CLIs using parser combinators and type hints
Project description
genbu
Genbu is a library for creating composable command-line interfaces.
Features
- Infer shell arguments parser from type hints.
- Override inferred parsers using shell parser combinators.
- Compose command-line interfaces declaratively (subcommands).
- Dispatch automatically to the appropriate command callback.
- Generate usage messages by using
genbu.usage
.
Install
pip install genbu
Usage
# hello.py
from genbu import Genbu
print(Genbu(lambda name: f"Hello, {name}!").run())
# Usage example: python hello.py --name "world"
See examples.
License
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
genbu-0.2.1.tar.gz
(21.0 kB
view hashes)
Built Distribution
genbu-0.2.1-py3-none-any.whl
(25.5 kB
view hashes)