genbu

Create CLIs using parser combinators and type hints


License
MIT
Install
pip install genbu==0.2.1

Documentation

genbu

GitHub Workflow Status PyPI PyPI - Python Version GitHub

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

MIT