Skip to content
Myr

features.md

This file

Path

docs/features.md

77 lines · 3.4 KiB · Markdown

Last changed by

:art: Tweak external links' format #36Sebastián Ramírezbefore adoption38c19f0

History of this file

Take it

:memo: Add first version of docsSebastián Ramírezbefore adoptionc24269f

lines 1–2why, one step back
1## Design based on **FastAPI**
2

:pencil: Rewording in docs and fix typosSebastián Ramírezbefore adoption7b115c3

line 3why, one step back
3**Typer** is <a href="https://fastapi.tiangolo.com" target="_blank">FastAPI</a>'s little sibling.

:memo: Add first version of docsSebastián Ramírezbefore adoptionc24269f

lines 4–22why, one step back
4
5It follows the same design and ideas. If you know FastAPI, you already know **Typer**... more or less.67## Just Modern Python89It's all based on standard **Python 3.6 type** declarations. No new syntax to learn. Just standard modern Python.1011If you need a 2 minute refresher of how to use Python types (even if you don't use FastAPI or Typer), check the FastAPI tutorial section: <a href="https://fastapi.tiangolo.com/python-types/" target="_blank">Python types intro</a>.1213You will also see a 20 seconds refresher on the section [Tutorial - User Guide: First Steps](tutorial/first-steps.md).1415## Editor support1617**Typer** was designed to be easy and intuitive to use, to ensure the best development experience. With autocompletion everywhere.1819You will rarely need to come back to the docs.2021Here's how your editor might help you:22

:art: Tweak external links' format #36Sebastián Ramírezbefore adoption38c19f0

line 23why, one step back
23* in <a href="https://code.visualstudio.com/" class="external-link" target="_blank">Visual Studio Code</a>:

:memo: Add first version of docsSebastián Ramírezbefore adoptionc24269f

lines 24–26why, one step back
24
25![editor support](img/vscode-completion.png)26

:art: Tweak external links' format #36Sebastián Ramírezbefore adoption38c19f0

line 27why, one step back
27* in <a href="https://www.jetbrains.com/pycharm/" class="external-link" target="_blank">PyCharm</a>:

:memo: Add first version of docsSebastián Ramírezbefore adoptionc24269f

lines 28–44why, one step back
28
29![editor support](img/pycharm-completion.png)3031You will get completion for everything. That's something no other CLI library provides right now.3233No more guessing what type was that variable, if it could be `None`, etc.3435### Short3637It has sensible **defaults** for everything, with optional configurations everywhere. All the parameters can be fine-tuned to do what you need, customize the help, callbacks per parameter, make them required or not, etc.3839But by default, it all **"just works"**.4041## User friendly CLI apps4243The resulting CLI apps created with **Typer** have the nice features of many "pro" command line programs you probably already love.44

:memo: :sparkles: :bug: Commands: docs, examples, tests, and fixSebastián Ramírezbefore adoptioned6701b

line 45why, one step back
45* Automatic help options for the main CLI program and all the its subcommands.

:pencil: Update docs with references to --install-completionSebastián Ramírezbefore adoption9b44a9f

lines 46–47why, one step back
46* Automatic command and subcommand structure handling (you will see more about subcommands in the Tutorial - User Guide).
47* Automatic autocompletion for the CLI app in all operating systems, in all the shells (Bash, Zsh, Fish, PowerShell), so that the final user of your app can just hit <kbd>TAB</kbd> and get the available options or subcommands. *

:memo: Add first version of docsSebastián Ramírezbefore adoptionc24269f

line 48why, one step back
48

:pencil: Rewording in docs and fix typosSebastián Ramírezbefore adoption7b115c3

line 49why, one step back
49!!! note "* Autocompletion"

:memo: Add first version of docsSebastián Ramírezbefore adoptionc24269f

lines 50–53why, one step back
50 For the autocompletion to work on all shells you also need to add the dependency `click-completion`.
5152 Just that. And **Typer** does the rest.53

:pencil: Update docs with references to --install-completionSebastián Ramírezbefore adoption9b44a9f

lines 54–57why, one step back
54 If **Typer** detects `click-completion` installed, it will automatically create 2 *CLI options*:
5556 * `--install-completion`: Install completion for the current shell.57 * `--show-completion`: Show completion for the current shell, to copy it or customize the installation.

:memo: Add first version of docsSebastián Ramírezbefore adoptionc24269f

lines 58–62why, one step back
58
59 Then you can tell the user to run that command and the rest will just work.6061## The power of Click62

:art: Tweak external links' format #36Sebastián Ramírezbefore adoption38c19f0

line 63why, one step back
63<a href="https://click.palletsprojects.com" class="external-link" target="_blank">Click</a> is one of the most popular tools for building CLIs in Python.

:memo: Add first version of docsSebastián Ramírezbefore adoptionc24269f

lines 64–77why, one step back
64
65**Typer** is based on it, so you get all its benefits, plug-ins, robustness, etc.6667But you can write simpler code with the benefits of modern Python.6869<!-- 7071TODO7273### Tested7475* 100% <abbr title="The amount of code that is automatically tested">test coverage</abbr>.76* 100% <abbr title="Python type annotations, with this your editor and external tools can give you better support">type annotated</abbr> code base.77* Used in production applications. -->