You get: great editor support, including completion and type checks everywhere. And there are tools to create groups of subcommands, add metadata, extra validation, etc. An example with two subcommands ¶Ĭreate a typer.Typer() app, and create two subcommands with their parameters.Īnd similarly for files, paths, enums (choices), etc. Note: auto-completion works when you create a Python package and run it with -install-completion or when you use Typer CLI. You get a nice error, you are missing NAME Usage: main.py NAME Try 'main.py -help' for help. Typer stands on the shoulders of a giant. Grow large: Grow in complexity as much as you want, create arbitrarily complex trees of commands and groups of subcommands, with options and arguments.Īnd it's intended to be the FastAPI of CLIs.Start simple: The simplest example adds only 2 lines of code to your app: 1 import, 1 function call.Multiple features from each parameter declaration. Automatic help, and automatic completion for all shells.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |