:memo: Add first version of docs
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sebastián Ramírez · committed by Sebastián Ramírez · parent 64d1a5f · Browse files · 8 files·+1477 added−0 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
8 files+1477 added−0 removed
- other:+1477 added−0 removed
Provenance
- Commit
c24269f- Tree
ec6ed0b- Author
Sebastián Ramírez <tiangolo@gmail.com>- Committer
Sebastián Ramírez <tiangolo@gmail.com>- Parent
64d1a5f
8 files changed+1477 added−0 removed
added:docs/tutorial/first-steps.md+397 added
1+## The simplest example2+3+The simplest Typer file could look like this:4+5+```Python6+{!./src/first_steps/tutorial001.py!}7+```8+9+Copy that to a file `main.py`.10+11+Test it:12+13+```bash14+python main.py15+```16+17+You will see an output like:18+19+```hl_lines=""20+Hello World21+```22+23+It just prints "Hello World".24+25+If you type:26+27+```bash28+python main.py --help29+```30+31+it shows:32+33+```34+Usage: main.py [OPTIONS]35+36+Options:37+ --help Show this message and exit.38+```39+40+...but this program is still not very useful. Let's increase that.41+42+## What is a **CLI argument**43+44+Here we will use the word **CLI argument** to refer to **CLI parameters** passed in some specific order to the CLI application. By default, they are *required*.45+46+If you go to your terminal and type:47+48+```bash49+ls ./myproject50+```51+52+`ls` will show the contents of the directory `./myproject`.53+54+* `ls` is the *command* (or "program", "CLI app").55+* `./myproject` is a *CLI argument*.56+57+They are a bit different from **CLI options** that you will see later below.58+59+## Add a CLI argument60+61+Update the previous example with an argument `name`:62+63+```Python hl_lines="4 5"64+{!./src/first_steps/tutorial002.py!}65+```66+67+If you run it without the argument:68+69+```bash70+python main.py71+```72+73+it shows:74+75+```76+Usage: main.py [OPTIONS] NAME77+Try "main.py --help" for help.78+79+Error: Missing argument "NAME".80+```81+82+Now pass that `name` *CLI argument*:83+84+```bash85+python main.py Camila86+```87+88+it shows:89+90+```91+Hello Camila92+```93+94+Here `Camila` is the *CLI argument*.95+96+## Two CLI arguments97+98+Now extend that to have 2 arguments, `name` and `lastname`:99+100+```Python hl_lines="4 5"101+{!./src/first_steps/tutorial003.py!}102+```103+104+Now get the help:105+106+```bash107+python main.py --help108+```109+110+it shows:111+112+```113+Usage: main.py [OPTIONS] NAME LASTNAME114+115+Options:116+ --help Show this message and exit.117+```118+119+There are now 2 *CLI arguments*, `name` and `lastname`.120+121+Now pass a single `name` argument:122+123+```bash124+python main.py Camila125+```126+127+it shows:128+129+```130+Usage: main.py [OPTIONS] NAME LASTNAME131+Try "main.py --help" for help.132+133+Error: Missing argument "LASTNAME".134+```135+136+These 2 arguments are required, so, pass both:137+138+```bash139+python main.py Camila Gutiérrez140+```141+142+it shows:143+144+```145+Hello Camila Gutiérrez146+```147+148+!!! tip149+ Notice that the order is important. The last name has to go after the first name.150+151+ If you called it with:152+153+ ```bash154+ python main.py Gutiérrez Camila155+ ```156+157+ your app wouldn't have a way to know which is the `name` and which the `lastname`. It expects the first *CLI argument* to be the `name` and the second *CLI argument* to be the `lastname`.158+159+## What is a **CLI option**160+161+Here we will use the word **CLI option** to refer to **CLI parameters** passed to the CLI application with a specific name. Because they have a name they don't depend on the order. By default they are *optional* (not *required*).162+163+They are a bit different from **CLI arguments** that you already created.164+165+If you go to your terminal and type:166+167+```bash168+ls ./myproject --size169+```170+171+`ls` will show the contents of the directory `./myproject` with their `size`.172+173+* `ls` is the *command* (or "program", "CLI app").174+* `./myproject` is a *CLI argument*.175+* `--size` is an optional *CLI option*.176+177+A *CLI option* like `--size` doesn't depend on the order like a *CLI argument*.178+179+The program knows it has to show the size because it sees `--size`, not because of the order.180+181+So, if you put the `--size` *before* the *CLI argument*, it still works:182+183+```bash184+ls --size ./myproject185+```186+187+!!! tip188+ In this example above the *CLI option* `--size` is just a "flag", it's a boolean value, `True` or `False`.189+190+ This one doesn't receive any values. But *CLI options* can also receive values like *CLI arguments*. You'll see how later.191+192+## Add one *CLI option*193+194+Now add a `--formal` *CLI option*:195+196+```Python hl_lines="4 5"197+{!./src/first_steps/tutorial004.py!}198+```199+200+Here `formal` is a `bool` that is `False` by default.201+202+If you get the help:203+204+```bash205+python main.py --help206+```207+208+it shows:209+210+```211+Usage: main.py [OPTIONS] NAME LASTNAME212+213+Options:214+ --formal / --no-formal215+ --help Show this message and exit.216+```217+218+!!! tip219+ Notice that it automatically creates a `--formal` and a `--no-formal` because it detected that `formal` is a `bool`.220+221+Now call it normally:222+223+```bash224+python main.py Camila Gutiérrez225+```226+227+it still shows:228+229+```230+Hello Camila Gutiérrez231+```232+233+But if you pass `--formal`:234+235+```bash236+python main.py Camila Gutiérrez --formal237+```238+239+it shows:240+241+```242+Good day Ms. Camila Gutiérrez.243+```244+245+And as `formal` is a *CLI option*, you can put it anywhere in this command:246+247+```bash248+python main.py Camila --formal Gutiérrez249+```250+251+and:252+253+```bash254+python main.py --formal Camila Gutiérrez255+```256+257+both still show:258+259+```260+Good day Ms. Camila Gutiérrez.261+```262+263+## A **CLI option* with a value264+265+Let's convert the `lastname` from a *CLI argument* to a *CLI option*:266+267+```Python hl_lines="4"268+{!./src/first_steps/tutorial005.py!}269+```270+271+As `lastname` now has a default value of `""` (an empty string) it is no longer required in the function, and **Typer** will now by default make it an optional *CLI option*.272+273+If you get the help:274+275+```bash276+python main.py --help277+```278+279+it now shows:280+281+```282+Usage: main.py [OPTIONS] NAME283+284+Options:285+ --lastname TEXT286+ --formal / --no-formal287+ --help Show this message and exit.288+```289+290+!!! tip291+ Notice the `--lastname`, and notice that it takes a textual value.292+293+If you call it without a `--lastname`:294+295+```bash296+python main.py Camila297+```298+299+it shows:300+301+```302+Hello Camila303+```304+305+and you can pass the `--lastname`:306+307+```bash308+python main.py Camila --lastname Gutiérrez309+```310+311+and it shows:312+313+```314+Hello Camila Gutiérrez315+```316+317+And as `--lastname` is now a *CLI option* that doesn't depend on the order, you can pass it before the name:318+319+```bash320+python main.py --lastname Gutiérrez Camila321+```322+323+and it will still work normally:324+325+```326+Hello Camila Gutiérrez327+```328+329+## Arguments, options, parameters, optional, required330+331+Be aware that these terms refer to multiple things depending on the context, and sadly, those "contexts" mix frequently, so it's easy to get confused.332+333+### In Python334+335+In Python, the names of the variables in a function, like `name` and `lastname`:336+337+```Python338+def main(name: str, lastname: str = ""):339+ pass340+```341+342+are called "Python function parameters" or "Python function arguments".343+344+!!! note "Technical Details"345+ There's actually a very small distinction in Python between "parameter" and "argument".346+347+ It's quite technical... and somewhat pedantic.348+349+ One refers to the variable name in a function *declaration*. Like:350+ 351+ ```Python352+ def bring_person(name: str, lastname: str = ""):353+ pass354+ ```355+356+ The other refers to the value passed when *calling* a function. Like:357+358+ ```Python359+ person = bring_person("Camila", lastname="Gutiérrez")360+ ```361+362+ ...but you will probably see them used interchangeably in most of the places (including here).363+364+#### Python default values365+366+In Python, in a function, a parameter with a *default value* like `lastname` in:367+368+```Python369+def main(name: str, lastname: str = ""):370+ pass371+```372+373+is considered an "optional parameter" (or "optional argument").374+375+The default value can be anything, like `""` or `None`.376+377+And a parameter like `name`, that doesn't have a default value, is considered *required*.378+379+### In CLIs380+381+When talking about command line interfaces/applications, the words "argument" and "parameter" are commonly used to refer to that data passed to a CLI app, those parameters.382+383+But those words don't imply anything about the data being required, needing to be passed in a certain order, nor having a flag like `--lastname`.384+385+The parameters that come with a flag like `--lastname` and a value (or when the flag itself is the value, like `--formal`) are commonly optional, not required. So, when talking about CLIs it's common to call them *optional arguments* or *optional parameters*.386+387+In reality, the parameters that require an order can be made *optional* too. And the ones that come with a flag (like `--lastname`) can be *required* too.388+389+### In **Typer**390+391+To try and make it a bit easier, we'll normally use the words "parameter" or "argument" to refer to Python functions.392+393+We'll use ***CLI argument*** to refer to those *CLI parameters* that depend on an order. That are **required** by default.394+395+And we'll use ***CLI option*** to refer to those *CLI parameters* that depend on a flag (like `--lastname`). That are **optional** by default.396+397+We will use ***CLI parameter*** to refer to both, *CLI arguments* and *CLI options*.added:docs/tutorial/intro.md+60 added
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960## Python types
If you need a refreshed about how to use Python type hints, check the first part of <a href="https://fastapi.tiangolo.com/python-types/" target="_blank">FastAPI's Python types intro</a>.
You can also check the <a href="https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html" target="_blank">mypy cheat sheet</a>.
In short (very short), you can declare a function with parameters like:
```Pythondef type_example(name: str, formal: bool = False, intro: str = None): pass```
And your editor (and Typer) will know that:
* `name` is of type `str` and is a required parameter.* `formal` is a `bool` and is by default `False`.* `intro` is a `str`, and by default is `None`, so it's optional.
These type hints are what gives you autocomplete in your editor and several other features.
Typer is based on these type hints.
## Intro
This tutorial shows you how to use **Typer** with all its features, step by step.
Each section gradually builds on the previous ones, but it's structured to separate topics, so that you can go directly to any specific one to solve your specific CLI needs.
It is also built to work as a future reference.
So you can come back and see exactly what you need.
## Run the code
All the code blocks can be copied and used directly (they are actually tested Python files).
To run any of the examples, copy the code to a file `main.py`, and run it:
```bashpython main.py```
It is **HIGHLY encouraged** that you write or copy the code, edit it and run it locally.
Using it in your editor is what really shows you the benefits of Typer, seeing how little code you have to write, all the type checks, autocompletion, etc.
---
## Install Typer
The first step is to install Typer.
For the tutorial, you might want to install it with all the optional dependencies and features:
```bashpip install typer[all]```
...that also includes `colorama` and `click-completion`.added:docs/alternatives.md+417 added
1+What inspired **Typer**, how it compares to other alternatives and what it learned from them.2+3+Coming soon...4+5+<!-- ## Intro6+7+**FastAPI** wouldn't exist if not for the previous work of others.8+9+There have been many tools created before that have helped inspire its creation.10+11+I have been avoiding the creation of a new framework for several years. First I tried to solve all the features covered by **FastAPI** using many different frameworks, plug-ins, and tools.12+13+But at some point, there was no other option than creating something that provided all these features, taking the best ideas from previous tools, and combining them in the best way possible, using language features that weren't even available before (Python 3.6+ type hints).14+15+## Previous tools16+17+### <a href="https://www.djangoproject.com/" target="_blank">Django</a>18+19+It's the most popular Python framework and is widely trusted. It is used to build systems like Instagram.20+21+It's relatively tightly coupled with relational databases (like MySQL or PostgreSQL), so, having a NoSQL database (like Couchbase, MongoDB, Cassandra, etc) as the main store engine is not very easy.22+23+It was created to generate the HTML in the backend, not to create APIs used by a modern frontend (like React, Vue.js and Angular) or by other systems (like <abbr title="Internet of Things">IoT</abbr> devices) communicating with it.24+25+### <a href="https://www.django-rest-framework.org/" target="_blank">Django REST Framework</a>26+27+Django REST framework was created to be a flexible toolkit for building Web APIs using Django underneath, to improve its API capabilities.28+29+It is used by many companies including Mozilla, Red Hat and Eventbrite.30+31+It was one of the first examples of **automatic API documentation**, and this was specifically one of the first ideas that inspired "the search for" **FastAPI**.32+33+!!! note34+ Django REST Framework was created by Tom Christie. The same creator of Starlette and Uvicorn, on which **FastAPI** is based.35+36+37+!!! check "Inspired **FastAPI** to"38+ Have an automatic API documentation web user interface.39+40+### <a href="http://flask.pocoo.org/" target="_blank">Flask</a>41+42+Flask is a "microframework", it doesn't include database integrations nor many of the things that come by default in Django.43+44+This simplicity and flexibility allow doing things like using NoSQL databases as the main data storage system.45+46+As it is very simple, it's relatively intuitive to learn, although the documentation gets somewhat technical at some points.47+48+It is also commonly used for other applications that don't necessarily need a database, user management, or any of the many features that come pre-built in Django. Although many of these features can be added with plug-ins.49+50+This decoupling of parts, and being a "microframework" that could be extended to cover exactly what is needed was a key feature that I wanted to keep.51+52+Given the simplicity of Flask, it seemed like a good match for building APIs. The next thing to find was a "Django REST Framework" for Flask.53+54+!!! check "Inspired **FastAPI** to"55+ Be a micro-framework. Making it easy to mix and match the tools and parts needed.56+57+ Have a simple and easy to use routing system.58+59+60+### <a href="http://docs.python-requests.org" target="_blank">Requests</a>61+62+**FastAPI** is not actually an alternative to **Requests**. Their scope is very different.63+64+It would actually be common to use Requests *inside* of a FastAPI application.65+66+But still, FastAPI got quite some inspiration from Requests.67+68+**Requests** is a library to *interact* with APIs (as a client), while **FastAPI** is a library to *build* APIs (as a server).69+70+They are, more or less, at opposite ends, complementing each other.71+72+Requests has a very simple and intuitive design, it's very easy to use, with sensible defaults. But at the same time, it's very powerful and customizable.73+74+That's why, as said in the official website:75+76+> Requests is one of the most downloaded Python packages of all time77+78+The way you use it is very simple. For example, to do a `GET` request, you would write:79+80+```Python81+response = requests.get("http://example.com/some/url")82+```83+84+The FastAPI counterpart API path operation could look like:85+86+```Python hl_lines="1"87+@app.get("/some/url")88+def read_url():89+ return {"message": "Hello World"}90+```91+92+See the similarities in `requests.get(...)` and `@app.get(...)`.93+94+!!! check "Inspired **FastAPI** to"95+ * Have a simple and intuitive API.96+ * Use HTTP method names (operations) directly, in a straightforward and intuitive way.97+ * Have sensible defaults, but powerful customizations.98+99+100+### <a href="https://swagger.io/" target="_blank">Swagger</a> / <a href="https://github.com/OAI/OpenAPI-Specification/" target="_blank">OpenAPI</a>101+102+The main feature I wanted from Django REST Framework was the automatic API documentation.103+104+Then I found that there was a standard to document APIs, using JSON (or YAML, an extension of JSON) called Swagger.105+106+And there was a web user interface for Swagger APIs already created. So, being able to generate Swagger documentation for an API would allow using this web user interface automatically.107+108+At some point, Swagger was given to the Linux Foundation, to be renamed OpenAPI.109+110+That's why when talking about version 2.0 it's common to say "Swagger", and for version 3+ "OpenAPI".111+112+!!! check "Inspired **FastAPI** to"113+ Adopt and use an open standard for API specifications, instead of a custom schema.114+115+ And integrate standards-based user interface tools:116+117+ * <a href="https://github.com/swagger-api/swagger-ui" target="_blank">Swagger UI</a>118+ * <a href="https://github.com/Rebilly/ReDoc" target="_blank">ReDoc</a>119+120+ These two were chosen for being fairly popular and stable, but doing a quick search, you could find dozens of additional alternative user interfaces for OpenAPI (that you can use with **FastAPI**).121+122+### Flask REST frameworks123+124+There are several Flask REST frameworks, but after investing the time and work into investigating them, I found that many are discontinued or abandoned, with several standing issues that made them unfit.125+126+### <a href="https://marshmallow.readthedocs.io/en/3.0/" target="_blank">Marshmallow</a>127+128+One of the main features needed by API systems is data "<abbr title="also called marshalling, conversion">serialization</abbr>" which is taking data from the code (Python) and converting it into something that can be sent through the network. For example, converting an object containing data from a database into a JSON object. Converting `datetime` objects into strings, etc.129+130+Another big feature needed by APIs is data validation, making sure that the data is valid, given certain parameters. For example, that some field is an `int`, and not some random string. This is especially useful for incoming data.131+132+Without a data validation system, you would have to do all the checks by hand, in code.133+134+These features are what Marshmallow was built to provide. It is a great library, and I have used it a lot before.135+136+But it was created before there existed Python type hints. So, to define every <abbr title="the definition of how data should be formed">schema</abbr> you need to use specific utils and classes provided by Marshmallow.137+138+!!! check "Inspired **FastAPI** to"139+ Use code to define "schemas" that provide data types and validation, automatically.140+141+### <a href="https://webargs.readthedocs.io/en/latest/" target="_blank">Webargs</a>142+143+Another big feature required by APIs is <abbr title="reading and converting to Python data">parsing</abbr> data from incoming requests.144+145+Webargs is a tool that was made to provide that on top of several frameworks, including Flask.146+147+It uses Marshmallow underneath to do the data validation. And it was created by the same developers.148+149+It's a great tool and I have used it a lot too, before having **FastAPI**.150+151+!!! info152+ Webargs was created by the same Marshmallow developers.153+154+!!! check "Inspired **FastAPI** to"155+ Have automatic validation of incoming request data.156+157+### <a href="https://apispec.readthedocs.io/en/stable/" target="_blank">APISpec</a>158+159+Marshmallow and Webargs provide validation, parsing and serialization as plug-ins.160+161+But documentation is still missing. Then APISpec was created.162+163+It is a plug-in for many frameworks (and there's a plug-in for Starlette too).164+165+The way it works is that you write the definition of the schema using YAML format inside the docstring of each function handling a route.166+167+And it generates OpenAPI schemas.168+169+That's how it works in Flask, Starlette, Responder, etc.170+171+But then, we have again the problem of having a micro-syntax, inside of a Python string (a big YAML).172+173+The editor can't help much with that. And if we modify parameters or Marshmallow schemas and forget to also modify that YAML docstring, the generated schema would be obsolete.174+175+!!! info176+ APISpec was created by the same Marshmallow developers.177+178+179+!!! check "Inspired **FastAPI** to"180+ Support the open standard for APIs, OpenAPI.181+182+### <a href="https://flask-apispec.readthedocs.io/en/latest/" target="_blank">Flask-apispec</a>183+184+It's a Flask plug-in, that ties together Webargs, Marshmallow and APISpec.185+186+It uses the information from Webargs and Marshmallow to automatically generate OpenAPI schemas, using APISpec.187+188+It's a great tool, very under-rated. It should be way more popular than many Flask plug-ins out there. It might be due to its documentation being too concise and abstract.189+190+This solved having to write YAML (another syntax) inside of Python docstrings.191+192+This combination of Flask, Flask-apispec with Marshmallow and Webargs was my favorite backend stack until building **FastAPI**.193+194+Using it led to the creation of several Flask full-stack generators. These are the main stack I (and several external teams) have been using up to now:195+196+* <a href="https://github.com/tiangolo/full-stack" target="_blank">https://github.com/tiangolo/full-stack</a>197+* <a href="https://github.com/tiangolo/full-stack-flask-couchbase" target="_blank">https://github.com/tiangolo/full-stack-flask-couchbase</a>198+* <a href="https://github.com/tiangolo/full-stack-flask-couchdb" target="_blank">https://github.com/tiangolo/full-stack-flask-couchdb</a>199+200+And these same full-stack generators were the base of the <a href="/project-generation/" target="_blank">**FastAPI** project generator</a>.201+202+!!! info203+ Flask-apispec was created by the same Marshmallow developers.204+205+!!! check "Inspired **FastAPI** to"206+ Generate the OpenAPI schema automatically, from the same code that defines serialization and validation.207+208+### <a href="https://nestjs.com/" target="_blank">NestJS</a> (and <a href="https://angular.io/" target="_blank">Angular</a>)209+210+This isn't even Python, NestJS is a JavaScript (TypeScript) NodeJS framework inspired by Angular.211+212+It achieves something somewhat similar to what can be done with Flask-apispec.213+214+It has an integrated dependency injection system, inspired by Angular two. It requires pre-registering the "injectables" (like all the other dependency injection systems I know), so, it adds to the verbosity and code repetition.215+216+As the parameters are described with TypeScript types (similar to Python type hints), editor support is quite good.217+218+But as TypeScript data is not preserved after compilation to JavaScript, it cannot rely on the types to define validation, serialization and documentation at the same time. Due to this and some design decisions, to get validation, serialization and automatic schema generation, it's needed to add decorators in many places. So, it becomes quite verbose.219+220+It can't handle nested models very well. So, if the JSON body in the request is a JSON object that has inner fields that in turn are nested JSON objects, it cannot be properly documented and validated.221+222+!!! check "Inspired **FastAPI** to"223+ Use Python types to have great editor support.224+225+ Have a powerful dependency injection system. Find a way to minimize code repetition.226+227+### <a href="https://sanic.readthedocs.io/en/latest/" target="_blank">Sanic</a>228+229+It was one of the first extremely fast Python frameworks based on `asyncio`. It was made to be very similar to Flask.230+231+!!! note "Technical Details"232+ It used <a href="https://github.com/MagicStack/uvloop" target="_blank">`uvloop`</a> instead of the default Python `asyncio` loop. That's what made it so fast.233+234+ It <a href="https://github.com/huge-success/sanic/issues/761" target="_blank">still doesn't implement the ASGI spec for Python asynchronous web development</a>, but it clearly inspired Uvicorn and Starlette, that are currently faster than Sanic in open benchmarks.235+236+!!! check "Inspired **FastAPI** to"237+ Find a way to have a crazy performance.238+ 239+ That's why **FastAPI** is based on Starlette, as it is the fastest framework available (tested by third-party benchmarks).240+241+### <a href="https://falconframework.org/" target="_blank">Falcon</a>242+243+Falcon is another high performance Python framework, it is designed to be minimal, and work as the foundation of other frameworks like Hug.244+245+It uses the previous standard for Python web frameworks (WSGI) which is synchronous, so it can't handle WebSockets and other use cases. Nevertheless, it also has a very good performance.246+247+It is designed to have functions that receive two parameters, one "request" and one "response". Then you "read" parts from the request, and "write" parts to the response. Because of this design, it is not possible to declare request parameters and bodies with standard Python type hints as function parameters.248+249+So, data validation, serialization, and documentation, have to be done in code, not automatically. Or they have to be implemented as a framework on top of Falcon, like Hug. This same distinction happens in other frameworks that are inspired by Falcon's design, of having one request object and one response object as parameters.250+251+!!! check "Inspired **FastAPI** to"252+ Find ways to get great performance.253+254+ Along with Hug (as Hug is based on Falcon) inspired **FastAPI** to declare a `response` parameter in functions.255+256+ Although in FastAPI it's optional, and is used mainly to set headers, cookies, and alternative status codes.257+258+### <a href="https://moltenframework.com/" target="_blank">Molten</a>259+260+I discovered Molten in the first stages of building **FastAPI**. And it has quite similar ideas:261+262+* Based on Python type hints.263+* Validation and documentation from these types.264+* Dependency Injection system.265+266+It doesn't use a data validation, serialization and documentation third-party library like Pydantic, it has its own. So, these data type definitions would not be reusable as easily.267+268+It requires a little bit more verbose configurations. And as it is based on WSGI (instead of ASGI), it is not designed to take advantage of the high-performance provided by tools like Uvicorn, Starlette and Sanic.269+270+The dependency injection system requires pre-registration of the dependencies and the dependencies are solved based on the declared types. So, it's not possible to declare more than one "component" that provides a certain type.271+272+Routes are declared in a single place, using functions declared in other places (instead of using decorators that can be placed right on top of the function that handles the endpoint). This is closer to how Django does it than to how Flask (and Starlette) does it. It separates in the code things that are relatively tightly coupled.273+274+!!! check "Inspired **FastAPI** to"275+ Define extra validations for data types using the "default" value of model attributes. This improves editor support, and it was not available in Pydantic before.276+277+ This actually inspired updating parts of Pydantic, to support the same validation declaration style (all this functionality is now already available in Pydantic).278+279+### <a href="http://www.hug.rest/" target="_blank">Hug</a>280+281+Hug was one of the first frameworks to implement the declaration of API parameter types using Python type hints. This was a great idea that inspired other tools to do the same.282+283+It used custom types in its declarations instead of standard Python types, but it was still a huge step forward.284+285+It also was one of the first frameworks to generate a custom schema declaring the whole API in JSON.286+287+It was not based on a standard like OpenAPI and JSON Schema. So it wouldn't be straightforward to integrate it with other tools, like Swagger UI. But again, it was a very innovative idea.288+289+It has an interesting, uncommon feature: using the same framework, it's possible to create APIs and also CLIs.290+291+As it is based on the previous standard for synchronous Python web frameworks (WSGI), it can't handle Websockets and other things, although it still has high performance too.292+293+!!! info294+ Hug was created by Timothy Crosley, the same creator of <a href="https://github.com/timothycrosley/isort" target="_blank">`isort`</a>, a great tool to automatically sort imports in Python files.295+296+!!! check "Ideas inspired in **FastAPI**"297+ Hug inspired parts of APIStar, and was one of the tools I found most promising, alongside APIStar.298+299+ Hug helped inspiring **FastAPI** to use Python type hints to declare parameters, and to generate a schema defining the API automatically.300+301+ Hug inspired **FastAPI** to declare a `response` parameter in functions to set headers and cookies.302+303+### <a href="https://github.com/encode/apistar" target="_blank">APIStar</a> (<= 0.5)304+305+Right before deciding to build **FastAPI** I found **APIStar** server. It had almost everything I was looking for and had a great design.306+307+It was one of the first implementations of a framework using Python type hints to declare parameters and requests that I ever saw (before NestJS and Molten). I found it more or less at the same time as Hug. But APIStar used the OpenAPI standard.308+309+It had automatic data validation, data serialization and OpenAPI schema generation based on the same type hints in several places.310+311+Body schema definitions didn't use the same Python type hints like Pydantic, it was a bit more similar to Marshmallow, so, editor support wouldn't be as good, but still, APIStar was the best available option.312+313+It had the best performance benchmarks at the time (only surpassed by Starlette).314+315+At first, it didn't have an automatic API documentation web UI, but I knew I could add Swagger UI to it.316+317+It had a dependency injection system. It required pre-registration of components, as other tools discussed above. But still, it was a great feature.318+319+I was never able to use it in a full project, as it didn't have security integration, so, I couldn't replace all the features I was having with the full-stack generators based on Flask-apispec. I had in my backlog of projects to create a pull request adding that functionality.320+321+But then, the project's focus shifted.322+323+It was no longer an API web framework, as the creator needed to focus on Starlette.324+325+Now APIStar is a set of tools to validate OpenAPI specifications, not a web framework.326+327+!!! info328+ APIStar was created by Tom Christie. The same guy that created:329+330+ * Django REST Framework331+ * Starlette (in which **FastAPI** is based)332+ * Uvicorn (used by Starlette and **FastAPI**)333+334+!!! check "Inspired **FastAPI** to"335+ Exist.336+337+ The idea of declaring multiple things (data validation, serialization and documentation) with the same Python types, that at the same time provided great editor support, was something I considered a brilliant idea.338+ 339+ And after searching for a long time for a similar framework and testing many different alternatives, APIStar was the best option available.340+341+ Then APIStar stopped to exist as a server and Starlette was created, and was a new better foundation for such a system. That was the final inspiration to build **FastAPI**.342+343+ I consider **FastAPI** a "spiritual successor" to APIStar, while improving and increasing the features, typing system, and other parts, based on the learnings from all these previous tools.344+345+## Used by **FastAPI**346+347+### <a href="https://pydantic-docs.helpmanual.io/" target="_blank">Pydantic</a>348+349+Pydantic is a library to define data validation, serialization and documentation (using JSON Schema) based on Python type hints.350+351+That makes it extremely intuitive.352+353+It is comparable to Marshmallow. Although it's faster than Marshmallow in benchmarks. And as it is based on the same Python type hints, the editor support is great.354+355+!!! check "**FastAPI** uses it to"356+ Handle all the data validation, data serialization and automatic model documentation (based on JSON Schema).357+358+ **FastAPI** then takes that JSON Schema data and puts it in OpenAPI, apart from all the other things it does.359+360+### <a href="https://www.starlette.io/" target="_blank">Starlette</a>361+362+Starlette is a lightweight <abbr title="The new standard for building asynchronous Python web">ASGI</abbr> framework/toolkit, which is ideal for building high-performance asyncio services.363+364+It is very simple and intuitive. It's designed to be easily extensible, and have modular components.365+366+It has:367+368+* Seriously impressive performance.369+* WebSocket support.370+* GraphQL support.371+* In-process background tasks.372+* Startup and shutdown events.373+* Test client built on requests.374+* CORS, GZip, Static Files, Streaming responses.375+* Session and Cookie support.376+* 100% test coverage.377+* 100% type annotated codebase.378+* Zero hard dependencies.379+380+Starlette is currently the fastest Python framework tested. Only surpassed by Uvicorn, which is not a framework, but a server.381+382+Starlette provides all the basic web microframework functionality.383+384+But it doesn't provide automatic data validation, serialization or documentation.385+386+That's one of the main things that **FastAPI** adds on top, all based on Python type hints (using Pydantic). That, plus the dependency injection system, security utilities, OpenAPI schema generation, etc.387+388+!!! note "Technical Details"389+ ASGI is a new "standard" being developed by Django core team members. It is still not a "Python standard" (a PEP), although they are in the process of doing that.390+391+ Nevertheless, it is already being used as a "standard" by several tools. This greatly improves interoperability, as you could switch Uvicorn for any other ASGI server (like Daphne or Hypercorn), or you could add ASGI compatible tools, like `python-socketio`.392+393+!!! check "**FastAPI** uses it to"394+ Handle all the core web parts. Adding features on top.395+396+ The class `FastAPI` itself inherits directly from the class `Starlette`.397+ 398+ So, anything that you can do with Starlette, you can do it directly with **FastAPI**, as it is basically Starlette on steroids.399+400+### <a href="https://www.uvicorn.org/" target="_blank">Uvicorn</a>401+402+Uvicorn is a lightning-fast ASGI server, built on uvloop and httptools.403+404+It is not a web framework, but a server. For example, it doesn't provide tools for routing by paths. That's something that a framework like Starlette (or **FastAPI**) would provide on top.405+406+It is the recommended server for Starlette and **FastAPI**.407+408+!!! check "**FastAPI** recommends it as"409+ The main web server to run **FastAPI** applications.410+411+ You can combine it with Gunicorn, to have an asynchronous multi-process server.412+413+ Check more details in the <a href="/deployment/" target="_blank">Deployment</a> section.414+415+## Benchmarks and speed416+417+To understand, compare, and see the difference between Uvicorn, Starlette and FastAPI, check the section about [Benchmarks](/benchmarks/). -->added:docs/contributing.md+125 added
1+First, you might want to see the basic ways to <a href="https://typer.tiangolo.com/help-typer/" target="_blank">help Typer and get help</a>.2+3+Coming soon...4+5+<!-- ## Developing6+7+If you already cloned the repository and you know that you need to deep dive in the code, here are some guidelines to set up your environment.8+9+10+### Pipenv11+12+If you are using <a href="https://pipenv.readthedocs.io/en/latest/" target="_blank">Pipenv</a>, you can create a virtual environment and install the packages with:13+14+```bash15+pipenv install --dev16+```17+18+Then you can activate that virtual environment with:19+20+```bash21+pipenv shell22+```23+24+25+### No Pipenv26+27+If you are not using Pipenv, you can create a virtual environment with your preferred tool, and install the packages listed in the file `Pipfile`.28+29+30+### Flit31+32+**FastAPI** uses <a href="https://flit.readthedocs.io/en/latest/index.html" target="_blank">Flit</a> to build, package and publish the project.33+34+If you installed the development dependencies with one of the methods above, you already have the `flit` command.35+36+To install your local version of FastAPI as a package in your local environment, run:37+38+```bash39+flit install --symlink40+```41+42+It will install your local FastAPI in your local environment.43+44+45+#### Using your local FastAPI46+47+If you create a Python file that imports and uses FastAPI, and run it with the Python from your local environment, it will use your local FastAPI source code.48+49+And if you update that local FastAPI source code, as it is installed with `--symlink`, when you run that Python file again, it will use the fresh version of FastAPI you just edited.50+51+That way, you don't have to "install" your local version to be able to test every change.52+53+54+### Format55+56+There is a script that you can run that will format and clean all your code:57+58+```bash59+bash scripts/lint.sh60+```61+62+It will also auto-sort all your imports.63+64+For it to sort them correctly, you need to have FastAPI installed locally in your environment, with the command in the section above:65+66+```bash67+flit install --symlink68+```69+70+71+### Docs72+73+The documentation uses <a href="https://www.mkdocs.org/" target="_blank">MkDocs</a>.74+75+All the documentation is in Markdown format in the directory `./docs`.76+77+Many of the tutorials have blocks of code.78+79+In most of the cases, these blocks of code are actual complete applications that can be run as is.80+81+In fact, those blocks of code are not written inside the Markdown, they are Python files in the `./docs/src/` directory.82+83+And those Python files are included/injected in the documentation when generating the site.84+85+86+#### Docs for tests87+88+Most of the tests actually run against the example source files in the documentation.89+90+This helps making sure that:91+92+* The documentation is up to date.93+* The documentation examples can be run as is.94+* Most of the features are covered by the documentation, ensured by the coverage tests.95+96+During local development, there is a script that builds the site and checks for any changes, live-reloading:97+98+```bash99+bash scripts/docs-live.sh100+```101+102+It will serve the documentation on `http://0.0.0.0:8008`.103+104+That way, you can edit the documentation/source files and see the changes live.105+106+#### Apps and docs at the same time107+108+And if you run the examples with, e.g.:109+110+```bash111+uvicorn tutorial001:app --reload112+```113+114+as Uvicorn by default will use the port `8000`, the documentation on port `8008` won't clash.115+116+117+### Tests118+119+There is a script that you can run locally to test all the code and generate coverage reports in HTML:120+121+```bash122+bash scripts/test-cov-html.sh123+```124+125+This command generates a directory `./htmlcov/`, if you open the file `./htmlcov/index.html` in your browser, you can explore interactively the regions of code that are covered by the tests, and notice if there is any region missing. -->added:docs/features.md+74 added
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374## Design based on **FastAPI**
**Typer** is the little sibling of <a href="https://fastapi.tiangolo.com" target="_blank">FastAPI</a>.
It follows the same design and ideas. If you know FastAPI, you already know **Typer**... more or less.
## Just Modern Python
It's all based on standard **Python 3.6 type** declarations. No new syntax to learn. Just standard modern Python.
If 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>.
You will also see a 20 seconds refresher on the section [Tutorial - User Guide: First Steps](tutorial/first-steps.md).
## Editor support
**Typer** was designed to be easy and intuitive to use, to ensure the best development experience. With autocompletion everywhere.
You will rarely need to come back to the docs.
Here's how your editor might help you:
* in <a href="https://code.visualstudio.com/" target="_blank">Visual Studio Code</a>:

* in <a href="https://www.jetbrains.com/pycharm/" target="_blank">PyCharm</a>:

You will get completion for everything. That's something no other CLI library provides right now.
No more guessing what type was that variable, if it could be `None`, etc.
### Short
It 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.
But by default, it all **"just works"**.
## User friendly CLI apps
The resulting CLI apps created with **Typer** have the nice features of many "pro" command line programs you probably already love.
* Automatic help commands and options.* Automatic command and sub-command structure handling (you will see more about sub-commands in the Tutorial - User Guide).* 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 options of sub-commands. *
!!! note * Autocompletion For the autocompletion to work on all shells you also need to add the dependency `click-completion`.
Just that. And **Typer** does the rest. If **Typer** detects `click-completion` installed, it will automatically create a command to install completion for the user's shell.
Then you can tell the user to run that command and the rest will just work.
## The power of Click
<a href="https://click.palletsprojects.com" target="_blank">Click</a> is one of the most popular tools for building CLIs in Python.
**Typer** is based on it, so you get all its benefits, plug-ins, robustness, etc.
But you can write simpler code with the benefits of modern Python.
<!--
TODO
### Tested
* 100% <abbr title="The amount of code that is automatically tested">test coverage</abbr>.* 100% <abbr title="Python type annotations, with this your editor and external tools can give you better support">type annotated</abbr> code base.* Used in production applications. -->added:docs/help-typer.md+92 added
1+Are you liking **Typer**?2+3+Would you like to help Typer, other users, and the author?4+5+Or would you like to get help with **Typer**?6+7+There are very simple ways to help (several involve just one or two clicks).8+9+And there are several ways to get help too.10+11+## Star **Typer** in GitHub12+13+You can "star" Typer in GitHub (clicking the star button at the top right): <a href="https://github.com/tiangolo/typer" target="_blank">https://github.com/tiangolo/typer</a>.14+15+By adding a star, other users will be able to find it more easily and see that it has been already useful for others.16+17+## Watch the GitHub repository for releases18+19+You can "watch" Typer in GitHub (clicking the "watch" button at the top right): <a href="https://github.com/tiangolo/typer" target="_blank">https://github.com/tiangolo/typer</a>.20+21+There you can select "Releases only".22+23+Doing it, you will receive notifications (in your email) whenever there's a new release (a new version) of **Typer** with bug fixes and new features.24+25+## Connect with the author26+27+You can connect with <a href="https://tiangolo.com" target="_blank">me (Sebastián Ramírez / `tiangolo`)</a>, the author.28+29+You can:30+31+* <a href="https://github.com/tiangolo" target="_blank">Follow me on **GitHub**</a>.32+ * See other Open Source projects I have created that could help you.33+ * Follow me to see when I create a new Open Source project.34+* <a href="https://twitter.com/tiangolo" target="_blank">Follow me on **Twitter**</a>.35+ * Tell me how you use Typer (I love to hear that).36+ * Ask questions.37+* <a href="https://www.linkedin.com/in/tiangolo/" target="_blank">Connect with me on **Linkedin**</a>.38+ * Talk to me.39+ * Endorse me or recommend me :)40+* Read what I write (or follow me):41+ * Read other ideas, articles and tools I have created.42+ * Follow me to see when I publish something new.43+ * On <a href="https://dev.to/tiangolo" target="_blank">**Dev.to**</a>.44+ * On <a href="https://medium.com/@tiangolo" target="_blank">**Medium**</a>.45+46+## Tweet about **Typer**47+48+<a href="http://twitter.com/home/?status=I'm loving Typer because... https://github.com/tiangolo/typer cc @tiangolo" target="_blank">Tweet about **Typer**</a> and let me and others know why you like it.49+50+## Let me know how are you using **Typer**51+52+I love to hear about how **Typer** is being used, what have you liked in it, in which project/company you are using it, etc.53+54+You can let me know:55+56+* <a href="http://twitter.com/home/?status=Hey @tiangolo, I'm using Typer at..." target="_blank">On **Twitter**</a>.57+* <a href="https://www.linkedin.com/in/tiangolo/" target="_blank">On **Linkedin**</a>.58+* <a href="https://dev.to/tiangolo" target="_blank">On **Dev.to**</a>.59+* <a href="https://medium.com/@tiangolo" target="_blank">On **Medium**</a>.60+61+## Help others with issues in GitHub62+63+You can see <a href="https://github.com/tiangolo/typer/issues" target="_blank">existing issues</a> and try and help others.64+65+## Watch the GitHub repository66+67+You can "watch" Typer in GitHub (clicking the "watch" button at the top right): <a href="https://github.com/tiangolo/typer" target="_blank">https://github.com/tiangolo/typer</a>.68+69+If you select "Watching" instead of "Releases only", you will receive notifications when someone creates a new issue.70+71+Then you can try and help them solving those issues.72+73+## Create issues74+75+You can <a href="https://github.com/tiangolo/typer/issues/new/choose" target="_blank">create a new issue</a> in the GitHub repository, for example to:76+77+* Report a bug/issue.78+* Suggest a new feature.79+* Ask a question.80+81+## Create a Pull Request82+83+You can <a href="https://github.com/tiangolo/typer" target="_blank">create a Pull Request</a>, for example:84+85+* To fix a typo you found on the documentation.86+* To propose new documentation sections.87+* To fix an existing issue/bug.88+* To add a new feature.89+90+---91+92+Thanks!added:docs/index.md+305 added
1+<p align="center">2+ <a href="https://typer.tiangolo.com"><img src="/img/logo-margin/logo-margin-vector.svg" alt="Typer"></a>3+</p>4+<p align="center">5+ <em>Typer: CLIs with autocompletion. While developing and using.</em>6+</p>7+<p align="center">8+<a href="https://travis-ci.org/tiangolo/typer" target="_blank">9+ <img src="https://travis-ci.org/tiangolo/typer.svg?branch=master" alt="Build Status">10+</a>11+<a href="https://codecov.io/gh/tiangolo/typer" target="_blank">12+ <img src="https://codecov.io/gh/tiangolo/typer/branch/master/graph/badge.svg" alt="Coverage">13+</a>14+<a href="https://pypi.org/project/typer" target="_blank">15+ <img src="https://badge.fury.io/py/typer.svg" alt="Package version">16+</a>17+</p>18+19+---20+21+**Documentation**: <a href="https://typer.tiangolo.com" target="_blank">https://typer.tiangolo.com</a>22+23+**Source Code**: <a href="https://github.com/tiangolo/typer" target="_blank">https://github.com/tiangolo/typer</a>24+25+---26+27+Typer is library to build <abbr title="command line interface, programs executed from a terminal">CLI</abbr> applications that users love using and developers love creating. Based on Python 3.6+ type hints.28+29+**Typer** is the little sibling of <a href="https://fastapi.tiangolo.com" target="_blank">FastAPI</a>. And it's intended to be the FastAPI of CLIs.30+31+The key features are:32+33+* **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.34+* **Easy to use**: It's easy to use for the final users. Automatic help commands, and (optional) automatic completion for all shells.35+* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.36+* **Start simple**: The simplest example adds only 2 lines of code to your app: **1 import, 1 function call**.37+* **Grow large**: Grow in complexity as much as you want create arbitrarily complex trees of commands and groups sub-commands, with options and arguments.38+39+## Requirements40+41+Python 3.6+42+43+Typer stands on the shoulders of a giant. Internally it uses <a href="https://click.palletsprojects.com/" target="_blank">Click</a>, that's the only dependency.44+45+## Installation46+47+```bash48+pip install typer49+```50+51+## Example52+53+### The absolute minimum54+55+* Create a file `main.py` with:56+57+```Python58+import typer59+60+61+def main(name: str):62+ typer.echo(f"Hello {name}")63+64+65+if __name__ == "__main__":66+ typer.run(main)67+```68+69+### Run it70+71+Run your application:72+73+```bash74+python main.py75+```76+77+you will get a response like:78+79+```80+Usage: main.py [OPTIONS] NAME81+Try "main.py --help" for help.82+83+Error: Missing argument "NAME".84+```85+86+Now pass the `NAME` *argument*:87+88+```bash89+python main.py Camila90+```91+92+You will get a response like:93+94+```95+Hello Camila96+```97+98+And you automatically get a `--help` command:99+100+```bash101+python main.py --help102+```103+104+shows:105+106+```107+Usage: main.py [OPTIONS] NAME108+109+Options:110+ --help Show this message and exit.111+```112+113+## Example upgrade114+115+The previous example was the extreme in terms of simplicity.116+117+Now let's see one a bit more complex.118+119+### An example with two sub-commands120+121+Modify the file `main.py`.122+123+Create a `typer.Typer()` app, and create two sub-commands with their parameters.124+125+```Python hl_lines="3 6 11 20"126+import typer127+128+app = typer.Typer()129+130+131+@app.command()132+def hello(name: str):133+ typer.echo(f"Hello {name}")134+135+136+@app.command()137+def goodbye(name: str, formal: bool = False):138+ if formal:139+ typer.echo(f"Goodbye Ms. {name}. Have a good day.")140+ else:141+ typer.echo(f"Bye {name}!")142+143+144+if __name__ == "__main__":145+ app()146+```147+148+And that will:149+150+* Explicitly create a `typer.Typer` app.151+ * The previous `typer.run` actually creates one implicitly for you.152+* Add two sub-commands with `@app.command()`.153+* Execute the `app()` itself, as if it was a function (instead of `typer.run`).154+155+### Run the upgraded example156+157+Get the main `--help`:158+159+```bash160+python main.py --help161+```162+163+shows:164+165+```166+Usage: main.py [OPTIONS] COMMAND [ARGS]...167+168+Options:169+ --help Show this message and exit.170+171+Commands:172+ goodbye173+ hello174+```175+176+You have 2 sub-commands (the 2 functions), `goodbye` and `hello`.177+178+Now get the help for `hello`:179+180+```bash181+python main.py hello --help182+```183+184+shows:185+186+```187+Usage: main.py hello [OPTIONS] NAME188+189+Options:190+ --help Show this message and exit.191+```192+193+And now get the help for `goodbye`:194+195+```bash196+python main.py goodbye --help197+```198+199+shows:200+201+```202+Usage: main.py goodbye [OPTIONS] NAME203+204+Options:205+ --formal / --no-formal206+ --help Show this message and exit.207+```208+209+Notice how it automatically creates a `--formal` and `--no-formal` for your `bool` *option*.210+211+---212+213+And of course, if you use it, it does what you expect:214+215+```bash216+python main.py hello Camila217+```218+219+shows:220+221+```222+Hello Camila223+```224+225+Then:226+227+```bash228+python main.py goodbye Camila229+```230+231+shows:232+233+```234+Bye Camila!235+```236+237+And:238+239+```bash240+python main.py goodbye --formal Camila241+```242+243+shows:244+245+```246+Goodbye Ms. Camila. Have a good day.247+```248+249+### Recap250+251+In summary, you declare **once** the types of parameters (*arguments* and *options*) as function parameters.252+253+You do that with standard modern Python types.254+255+You don't have to learn a new syntax, the methods or classes of a specific library, etc.256+257+Just standard **Python 3.6+**.258+259+For example, for an `int`:260+261+```Python262+total: int263+```264+265+or for a `bool` flag:266+267+```Python268+force: bool269+```270+271+And similarly for **files**, **paths**, **enums** (choices), etc. And there are tools to create **groups of sub-commands**, add metadata, extra **validation**, etc.272+273+**You get**: great editor support, including **completion** and **type checks** everywhere.274+275+**Your users get**: automatic **`--help`**, (optional) **autocompletion** in their terminal (Bash, Zsh, Fish, PowerShell).276+277+For a more complete example including more features, see the <a href="https://typer.tiangolo.com/tutorial/intro/">Tutorial - User Guide</a>.278+279+## Optional Dependencies280+281+Typer uses <a href="https://click.palletsprojects.com/" target="_blank">Click</a> internally. That's the only dependency.282+283+But you can install extras:284+285+* <a href="https://pypi.org/project/colorama/" target="_blank"><code>colorama</code></a>: and Click will automatically use it to make sure colors always work correctly, even in Windows.286+ * Then you can use any tool you want to output colors in all the systems, including the integrated `typer.style()` and `typer.secho()` (provided by Click).287+ * Or any other tool, e.g. <a href="https://pypi.org/project/wasabi/" target="_blank"><code>wasabi</code></a>, <a href="https://github.com/erikrose/blessings" target="_blank"><code>blessings</code></a>.288+* <a href="https://github.com/click-contrib/click-completion" target="_blank"><code>click-completion</code></a>: and Typer will automatically configure it to provide completion for all the shells, including installation commands.289+290+You can install `typer` with `colorama` and `click-completion` with `pip3 install typer[all]`.291+292+## Other tools and plug-ins293+294+Click has many plug-ins available that you can use. And there are many tools that help with command line applications that you can use as well, even if they are not related to Typer or Click.295+296+For example:297+298+* <a href="https://github.com/click-contrib/click-spinner" target="_blank"><code>click-spinner</code></a>: to show the user that you are loading data. A Click plug-in.299+ * * There are several other Click plug-ins at <a href="https://github.com/click-contrib" target="_blank">click-contrib</a> that you can explore.300+* <a href="https://pypi.org/project/tabulate/" target="_blank"><code>tabulate</code></a>: to automatically display tabular data nicely. Independent of Click or typer.301+* etc... you can re-use many of the great available tools for building CLIs.302+303+## License304+305+This project is licensed under the terms of the MIT license.added:docs/release-notes.md+7 added
1234567## Latest changes
* Add initial version of code, docs, etc.
## 0.0.1
* First commit. Publish to PyPI to reserve package name.