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 details)
Built Distribution
genbu-0.2.1-py3-none-any.whl
(25.5 kB
view details)
File details
Details for the file genbu-0.2.1.tar.gz
.
File metadata
- Download URL: genbu-0.2.1.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a11cffdbaa2d655c077f9cfd9a3bb208f79a32ab153689a6a30d34660e3ebaed |
|
MD5 | 2c8cddcb50e4af5f0b55dda9631f640b |
|
BLAKE2b-256 | 12ae7b0923c752af0d9c13e97386d38c67d025a7cf675c80bd8009875302cc40 |
File details
Details for the file genbu-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: genbu-0.2.1-py3-none-any.whl
- Upload date:
- Size: 25.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50d46c0f9b962b627f433da13d072ff9096b643dfcbe8209cad1c57f1b8d2b9c |
|
MD5 | c77d2f10ac52b0a66f3be844a558c79b |
|
BLAKE2b-256 | ae19e6e197857a8ca8dbe9ec9dedc245d278b8390d651bb4ffeb8b455cbdb635 |