Bug#978694: RFP: python3-typer -- command line parsing library based on type hints
Package: wnpp
Severity: wishlist
* Package name : python3-typer
Version : 0.3.2
Upstream Author : Sebastián Ramírez
* URL : https://github.com/tiangolo/typer
* License : MIT
Programming Lang: Python 3.6+
Description : command line parsing library based on type hints
Typer is a library for building CLI applications that users will love using and developers will love creating. Based on Python 3.6+ type hints.
The key features are:
* Intuitive to write: Great editor support. Completion everywhere. Less time debugging. Designed to be easy to use and learn. Less time reading docs.
* Easy to use: It's easy to use for the final users. Automatic help, and automatic completion for all shells.
* Short: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
* Start simple: The simplest example adds only 2 lines of code to your app: 1 import, 1 function call.
* Grow large: Grow in complexity as much as you want, create arbitrarily complex trees of commands and groups of subcommands, with options and arguments.
E.g. this code:
import typer
def main(name: str):
typer.echo(f"Hello {name}")
if __name__ == "__main__":
typer.run(main)
is enough to enable this:
$ python main.py --help
Usage: main.py [OPTIONS] NAME
Arguments:
NAME [required]
Options:
--install-completion Install completion for the current shell.
--show-completion Show completion for the current shell, to copy it or customize the installation.
--help Show this message and exit.
P.S. I don’t have an immediate use for this, so I’m filing it as an RFP, but
I intend to package it some time soon if nobody beats me to it.
--
Cheers,
Andrej
Reply to: