Skip to content
Myr

index.md

This file

Path

docs/index.md

384 lines ยท 13.7 KiB ยท Markdown

Last changed by

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

History of this file

Take it

The walk stopped after 200 commits: lines older than ddeebf1 point at it.

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 1โ€“13why, one step back
1<p align="center">
2 <a href="https://typer.tiangolo.com"><img src="https://typer.tiangolo.com/img/logo-margin/logo-margin-vector.svg" alt="Typer"></a>3</p>4<p align="center">5 <em>Typer, build great CLIs. Easy to code. Based on Python type hints.</em>6</p>7<p align="center">8<a href="https://github.com/tiangolo/typer/actions?query=workflow%3ATest" target="_blank">9 <img src="https://github.com/tiangolo/typer/workflows/Test/badge.svg" alt="Test">10</a>11<a href="https://github.com/tiangolo/typer/actions?query=workflow%3APublish" target="_blank">12 <img src="https://github.com/tiangolo/typer/workflows/Publish/badge.svg" alt="Publish">13</a>

๐Ÿ‘ท Move from pytest-cov to coverage and Codecov to Smokeshow (#483)Sebastiรกn Ramรญrezbefore adoptionb988f6f

lines 14โ€“15why, one step back
14<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/tiangolo/typer" target="_blank">
15 <img src="https://coverage-badge.samuelcolvin.workers.dev/tiangolo/typer.svg" alt="Coverage">

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 16โ€“28why, one step back
16<a href="https://pypi.org/project/typer" target="_blank">
17 <img src="https://img.shields.io/pypi/v/typer?color=%2334D058&label=pypi%20package" alt="Package version">18</a>19</p>2021---2223**Documentation**: <a href="https://typer.tiangolo.com" target="_blank">https://typer.tiangolo.com</a>2425**Source Code**: <a href="https://github.com/tiangolo/typer" target="_blank">https://github.com/tiangolo/typer</a>2627---28

๐Ÿ”ฅ Remove support for Python 3.6 (#758)Sebastiรกn Ramรญrezbefore adoption13404a0

line 29why, one step back
29Typer is a library for building <abbr title="command line interface, programs executed from a terminal">CLI</abbr> applications that users will **love using** and developers will **love creating**. Based on Python type hints.

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

line 30why, one step back
30

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

lines 31โ€“32why, one step back
31It's also a command line tool to run scripts, automatically converting them to CLI applications.
32

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 33โ€“39why, one step back
33The key features are:
3435* **Intuitive to write**: Great editor support. <abbr title="also known as auto-complete, autocompletion, IntelliSense">Completion</abbr> everywhere. Less time debugging. Designed to be easy to use and learn. Less time reading docs.36* **Easy to use**: It's easy to use for the final users. Automatic help, and automatic completion for all shells.37* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.38* **Start simple**: The simplest example adds only 2 lines of code to your app: **1 import, 1 function call**.39* **Grow large**: Grow in complexity as much as you want, create arbitrarily complex trees of commands and groups of subcommands, with options and arguments.

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

line 40why, one step back
40* **Run scripts**: Typer includes a `typer` command that you can use to run scripts, automatically converting them to CLIs, even if they don't use Typer internally.

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 41โ€“43why, one step back
41
42## FastAPI of CLIs43

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

line 44why, one step back
44**Typer** is <a href="https://fastapi.tiangolo.com" class="external-link" target="_blank">FastAPI</a>'s little sibling, it's the FastAPI of CLIs.

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 45โ€“50why, one step back
45
46## Installation4748<div class="termy">4950```console

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

line 51why, one step back
51$ pip install typer

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

line 52why, one step back
52---> 100%

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

line 53why, one step back
53Successfully installed typer rich shellingham

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 54โ€“64why, one step back
54```
5556</div>5758## Example5960### The absolute minimum6162* Create a file `main.py` with:6364```Python

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

lines 65โ€“121why, one step back
65def main(name: str):
66 print(f"Hello {name}")67```6869This script doesn't even use Typer internally. But you can use the `typer` command to run it as a CLI application.7071### Run it7273Run your application with the `typer` command:7475<div class="termy">7677```console78// Run your application79$ typer main.py run8081// You get a nice error, you are missing NAME82Usage: typer [PATH_OR_MODULE] run [OPTIONS] NAME83Try 'typer [PATH_OR_MODULE] run --help' for help.84โ•ญโ”€ Error โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ85โ”‚ Missing argument 'NAME'. โ”‚86โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ878889// You get a --help for free90$ typer main.py run --help9192Usage: typer [PATH_OR_MODULE] run [OPTIONS] NAME9394Run the provided Typer app.9596โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ97โ”‚ * name TEXT [default: None] [required] |98โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ99โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ100โ”‚ --help Show this message and exit. โ”‚101โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ102103// Now pass the NAME argument104$ typer main.py run Camila105106Hello Camila107108// It works! ๐ŸŽ‰109```110111</div>112113This is the simplest use case, not even using Typer internally, but it can already be quite useful for simple scripts.114115**Note**: auto-completion works when you create a Python package and run it with `--install-completion` or when you use the `typer` command.116117## Use Typer in your code118119Now let's start using Typer in your own code, update `main.py` with:120121```Python

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 122โ€“132why, one step back
122import typer
123124125def main(name: str):126 print(f"Hello {name}")127128129if __name__ == "__main__":130 typer.run(main)131```132

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

line 133why, one step back
133Now you could run it with Python directly:

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 134โ€“141why, one step back
134
135<div class="termy">136137```console138// Run your application139$ python main.py140141// You get a nice error, you are missing NAME

๐Ÿ“ Tweak docs, Custom Types path, main page and READAME colors, broken links (#588)Sebastiรกn Ramรญrezbefore adoptione7c3467

lines 142โ€“146why, one step back
142Usage: main.py [OPTIONS] NAME
143Try 'main.py --help' for help.144โ•ญโ”€ Error โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ145โ”‚ Missing argument 'NAME'. โ”‚146โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 147โ€“151why, one step back
147
148149// You get a --help for free150$ python main.py --help151

๐Ÿ“ Tweak docs, Custom Types path, main page and READAME colors, broken links (#588)Sebastiรกn Ramรญrezbefore adoptione7c3467

line 152why, one step back
152Usage: main.py [OPTIONS] NAME

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

line 153why, one step back
153

๐Ÿ“ Tweak docs, Custom Types path, main page and READAME colors, broken links (#588)Sebastiรกn Ramรญrezbefore adoptione7c3467

lines 154โ€“159why, one step back
154โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
155โ”‚ * name TEXT [default: None] [required] |156โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ157โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ158โ”‚ --help Show this message and exit. โ”‚159โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 160โ€“170why, one step back
160
161// Now pass the NAME argument162$ python main.py Camila163164Hello Camila165166// It works! ๐ŸŽ‰167```168169</div>170

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

line 171why, one step back
171**Note**: you can also call this same script with the `typer` command, but you don't need to.

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 172โ€“223why, one step back
172
173## Example upgrade174175This was the simplest example possible.176177Now let's see one a bit more complex.178179### An example with two subcommands180181Modify the file `main.py`.182183Create a `typer.Typer()` app, and create two subcommands with their parameters.184185```Python hl_lines="3 6 11 20"186import typer187188app = typer.Typer()189190191@app.command()192def hello(name: str):193 print(f"Hello {name}")194195196@app.command()197def goodbye(name: str, formal: bool = False):198 if formal:199 print(f"Goodbye Ms. {name}. Have a good day.")200 else:201 print(f"Bye {name}!")202203204if __name__ == "__main__":205 app()206```207208And that will:209210* Explicitly create a `typer.Typer` app.211 * The previous `typer.run` actually creates one implicitly for you.212* Add two subcommands with `@app.command()`.213* Execute the `app()` itself, as if it was a function (instead of `typer.run`).214215### Run the upgraded example216217Check the new help:218219<div class="termy">220221```console222$ python main.py --help223

๐Ÿ“ Tweak docs, Custom Types path, main page and READAME colors, broken links (#588)Sebastiรกn Ramรญrezbefore adoptione7c3467

line 224why, one step back
224 Usage: main.py [OPTIONS] COMMAND [ARGS]...

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

line 225why, one step back
225

๐Ÿ“ Tweak docs, Custom Types path, main page and READAME colors, broken links (#588)Sebastiรกn Ramรญrezbefore adoptione7c3467

lines 226โ€“244why, one step back
226โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
227โ”‚ --install-completion Install completion โ”‚228โ”‚ for the current โ”‚229โ”‚ shell. โ”‚230โ”‚ --show-completion Show completion for โ”‚231โ”‚ the current shell, โ”‚232โ”‚ to copy it or โ”‚233โ”‚ customize the โ”‚234โ”‚ installation. โ”‚235โ”‚ --help Show this message โ”‚236โ”‚ and exit. โ”‚237โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ238โ•ญโ”€ Commands โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ239โ”‚ goodbye โ”‚240โ”‚ hello โ”‚241โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ242243// When you create a package you get โœจ auto-completion โœจ for free, installed with --install-completion244

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 245โ€“256why, one step back
245// You have 2 subcommands (the 2 functions): goodbye and hello
246```247248</div>249250Now check the help for the `hello` command:251252<div class="termy">253254```console255$ python main.py hello --help256

๐Ÿ“ Tweak docs, Custom Types path, main page and READAME colors, broken links (#588)Sebastiรกn Ramรญrezbefore adoptione7c3467

lines 257โ€“264why, one step back
257 Usage: main.py hello [OPTIONS] NAME
258259โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ260โ”‚ * name TEXT [default: None] [required] โ”‚261โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ262โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ263โ”‚ --help Show this message and exit. โ”‚264โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 265โ€“275why, one step back
265```
266267</div>268269And now check the help for the `goodbye` command:270271<div class="termy">272273```console274$ python main.py goodbye --help275

๐Ÿ“ Tweak docs, Custom Types path, main page and READAME colors, broken links (#588)Sebastiรกn Ramรญrezbefore adoptione7c3467

lines 276โ€“285why, one step back
276 Usage: main.py goodbye [OPTIONS] NAME
277278โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ279โ”‚ * name TEXT [default: None] [required] โ”‚280โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ281โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ282โ”‚ --formal --no-formal [default: no-formal] โ”‚283โ”‚ --help Show this message โ”‚284โ”‚ and exit. โ”‚285โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 286โ€“325why, one step back
286
287// Automatic --formal and --no-formal for the bool option ๐ŸŽ‰288```289290</div>291292Now you can try out the new command line application:293294<div class="termy">295296```console297// Use it with the hello command298299$ python main.py hello Camila300301Hello Camila302303// And with the goodbye command304305$ python main.py goodbye Camila306307Bye Camila!308309// And with --formal310311$ python main.py goodbye --formal Camila312313Goodbye Ms. Camila. Have a good day.314```315316</div>317318### Recap319320In summary, you declare **once** the types of parameters (*CLI arguments* and *CLI options*) as function parameters.321322You do that with standard modern Python types.323324You don't have to learn a new syntax, the methods or classes of a specific library, etc.325

๐Ÿ”ฅ Remove support for Python 3.6 (#758)Sebastiรกn Ramรญrezbefore adoption13404a0

line 326why, one step back
326Just standard **Python**.

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 327โ€“343why, one step back
327
328For example, for an `int`:329330```Python331total: int332```333334or for a `bool` flag:335336```Python337force: bool338```339340And similarly for **files**, **paths**, **enums** (choices), etc. And there are tools to create **groups of subcommands**, add metadata, extra **validation**, etc.341342**You get**: great editor support, including **completion** and **type checks** everywhere.343

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

line 344why, one step back
344**Your users get**: automatic **`--help`**, **auto-completion** in their terminal (Bash, Zsh, Fish, PowerShell) when they install your package or when using the `typer` command.

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 345โ€“347why, one step back
345
346For a more complete example including more features, see the <a href="https://typer.tiangolo.com/tutorial/">Tutorial - User Guide</a>.347

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

line 348why, one step back
348## Dependencies

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

line 349why, one step back
349

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

line 350why, one step back
350**Typer** stands on the shoulders of a giant. Its only internal required dependency is <a href="https://click.palletsprojects.com/" class="external-link" target="_blank">Click</a>.

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

line 351why, one step back
351

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

line 352why, one step back
352By default it also comes with extra standard dependencies:

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

line 353why, one step back
353

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

lines 354โ€“355why, one step back
354* <a href="https://rich.readthedocs.io/en/stable/index.html" class="external-link" target="_blank"><code>rich</code></a>: to show nicely formatted errors automatically.
355* <a href="https://github.com/sarugaku/shellingham" class="external-link" target="_blank"><code>shellingham</code></a>: to automatically detect the current shell when installing completion.

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 356โ€“357why, one step back
356 * With `shellingham` you can just use `--install-completion`.
357 * Without `shellingham`, you have to pass the name of the shell to install completion for, e.g. `--install-completion bash`.

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

lines 358โ€“360why, one step back
358* `typer-cli`: adds the `typer` command to your shell:
359 * Quickly run scripts (that don't have to use Typer) with shell completion.360 * Generate docs for your Typer applications.

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

line 361why, one step back
361

โœจ Add `typer-slim` package without extras, make `typer` include `typer-slim[default]` and integrate Typer CLI (`typer` command) into Typer (#780)Sebastiรกn Ramรญrezbefore adoption7d5d6bb

lines 362โ€“380why, one step back
362### `typer-slim`
363364If you don't want the extra dependencies, install `typer-slim` instead.365366When you install with:367368```bash369pip install typer370```371372...it's the equivalent of:373374```bash375pip install "typer-slim[standard]"376```377378The `standard` extra dependencies are `rich`, `shellingham`, `typer-cli`.379380**Note**: even if you don't install `typer-cli` you can still use it's functionality by calling `typer` as a module, e.g. `python -m typer`.

โœ Fix broken plac link (#275)Michael Gieldabefore adoptionddeebf1

lines 381โ€“384why, one step back
381
382## License383384This project is licensed under the terms of the MIT license.