You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Typer** is <ahref="https://fastapi.tiangolo.com"class="external-link"target="_blank">FastAPI</a>'s little sibling, it's the FastAPI of CLIs.
45
+
**Typer** is [FastAPI](https://fastapi.tiangolo.com)'s little sibling, it's the FastAPI of CLIs.
46
46
47
47
## Installation
48
48
49
-
Create and activate a <ahref="https://typer.tiangolo.com/virtual-environments/"class="external-link"target="_blank">virtual environment</a> and then install **Typer**:
49
+
Create and activate a [virtual environment](https://typer.tiangolo.com/virtual-environments/) and then install **Typer**:
50
50
51
51
<divclass="termy">
52
52
@@ -354,9 +354,9 @@ For a more complete example including more features, see the <a href="https://ty
354
354
355
355
**Typer** stands on the shoulders of giants. It has three required dependencies:
356
356
357
-
*<ahref="https://click.palletsprojects.com/"class="external-link"target="_blank">Click</a>: a popular tool for building CLIs in Python. Typer is based on it.
358
-
*<ahref="https://rich.readthedocs.io/en/stable/index.html"class="external-link"target="_blank"><code>rich</code></a>: to show nicely formatted errors automatically.
359
-
*<ahref="https://github.com/sarugaku/shellingham"class="external-link"target="_blank"><code>shellingham</code></a>: to automatically detect the current shell when installing completion.
357
+
*[Click](https://click.palletsprojects.com/): a popular tool for building CLIs in Python. Typer is based on it.
358
+
*[`rich`](https://rich.readthedocs.io/en/stable/index.html): to show nicely formatted errors automatically.
359
+
*[`shellingham`](https://github.com/sarugaku/shellingham): to automatically detect the current shell when installing completion.
Click is one of the most widely used libraries to create CLIs in Python.
64
64
@@ -76,11 +76,11 @@ Everything. 🚀
76
76
77
77
**Typer** mainly adds a layer on top of Click, making the code simpler and easier to use, with autocompletion everywhere, etc, but providing all the powerful features of Click underneath.
78
78
79
-
As someone pointed out: <em><ahref="https://twitter.com/fishnets88/status/1210126833745838080"class="external-link"target="_blank">"Nice to see it is built on Click but adds the type stuff. Me gusta!"</a></em>
79
+
As someone pointed out: <em>["Nice to see it is built on Click but adds the type stuff. Me gusta!"](https://twitter.com/fishnets88/status/1210126833745838080)</em>
I created **FastAPI** to provide an easy way to build APIs with autocompletion for everything in the code (and some other <ahref="https://fastapi.tiangolo.com/features/"class="external-link"target="_blank">features</a>).
99
+
I created **FastAPI** to provide an easy way to build APIs with autocompletion for everything in the code (and some other [features](https://fastapi.tiangolo.com/features/)).
Copy file name to clipboardExpand all lines: docs/contributing.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
# Development - Contributing
2
2
3
-
First, you might want to see the basic ways to [help Typer and get help](help-typer.md){.internal-link target=_blank}.
3
+
First, you might want to see the basic ways to [help Typer and get help](help-typer.md).
4
4
5
5
## Developing
6
6
7
-
If you already cloned the <ahref="https://github.com/fastapi/typer"class="external-link"target="_blank">typer repository</a> and you want to deep dive in the code, here are some guidelines to set up your environment.
7
+
If you already cloned the [typer repository](https://github.com/fastapi/typer) and you want to deep dive in the code, here are some guidelines to set up your environment.
The instructions here show you how to use the script at `./scripts/docs.py` with the `python` program directly.
255
255
256
-
But you can also use <ahref="https://typer.tiangolo.com/typer-cli/"class="external-link"target="_blank">Typer CLI</a>, and you will get autocompletion in your terminal for the commands after installing completion.
256
+
But you can also use [Typer CLI](https://typer.tiangolo.com/typer-cli/), and you will get autocompletion in your terminal for the commands after installing completion.
257
257
258
258
If you install Typer CLI, you can install completion with:
259
259
@@ -270,7 +270,7 @@ Completion will take effect once you restart the terminal.
270
270
271
271
### Docs Structure
272
272
273
-
The documentation uses <ahref="https://www.mkdocs.org/"class="external-link"target="_blank">MkDocs</a>.
273
+
The documentation uses [MkDocs](https://www.mkdocs.org/).
274
274
275
275
And there are extra tools/scripts in place in `./scripts/docs.py`.
276
276
@@ -316,7 +316,7 @@ The same applies to comments and descriptions, please don't copy paste the conte
316
316
317
317
### Human Effort Denial of Service
318
318
319
-
Using automated tools and AI to submit PRs or comments that we have to carefully review and handle would be the equivalent of a <ahref="https://en.wikipedia.org/wiki/Denial-of-service_attack"class="external-link"target="_blank">Denial-of-service attack</a> on our human effort.
319
+
Using automated tools and AI to submit PRs or comments that we have to carefully review and handle would be the equivalent of a [Denial-of-service attack](https://en.wikipedia.org/wiki/Denial-of-service_attack) on our human effort.
320
320
321
321
It would be very little effort from the person submitting the PR (an LLM prompt) that generates a large amount of effort on our side (carefully reviewing code).
Copy file name to clipboardExpand all lines: docs/environment-variables.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ print(f"Hello {name} from Python")
67
67
68
68
/// tip
69
69
70
-
The second argument to <ahref="https://docs.python.org/3.8/library/os.html#os.getenv"class="external-link"target="_blank">`os.getenv()`</a> is the default value to return.
70
+
The second argument to [`os.getenv()`](https://docs.python.org/3.8/library/os.html#os.getenv) is the default value to return.
71
71
72
72
If not provided, it's `None` by default, here we provide `"World"` as the default value to use.
73
73
@@ -155,7 +155,7 @@ Hello World from Python
155
155
156
156
/// tip
157
157
158
-
You can read more about it at <ahref="https://12factor.net/config"class="external-link"target="_blank">The Twelve-Factor App: Config</a>.
158
+
You can read more about it at [The Twelve-Factor App: Config](https://12factor.net/config).
159
159
160
160
///
161
161
@@ -165,7 +165,7 @@ These environment variables can only handle **text strings**, as they are extern
165
165
166
166
That means that **any value** read in Python from an environment variable **will be a `str`**, and any conversion to a different type or any validation has to be done in code.
167
167
168
-
You will learn more about using environment variables for your <abbrtitle="command line interface">CLI</abbr> applications later in the section about [CLI Arguments with Environment Variables](./tutorial/arguments/envvar.md){.internal-link target=_blank}.
168
+
You will learn more about using environment variables for your <abbrtitle="command line interface">CLI</abbr> applications later in the section about [CLI Arguments with Environment Variables](./tutorial/arguments/envvar.md).
This information will be useful when learning about [Virtual Environments](virtual-environments.md){.internal-link target=_blank}.
286
+
This information will be useful when learning about [Virtual Environments](virtual-environments.md).
287
287
288
288
It will also be useful when you **create your own CLI programs** as, for them to be available for your users, they will need to be somewhere in the `PATH` environment variable.
289
289
290
290
## Conclusion
291
291
292
292
With this you should have a basic understanding of what **environment variables** are and how to use them in Python.
293
293
294
-
You can also read more about them in the <ahref="https://en.wikipedia.org/wiki/Environment_variable"class="external-link"target="_blank">Wikipedia for Environment Variable</a>.
294
+
You can also read more about them in the [Wikipedia for Environment Variable](https://en.wikipedia.org/wiki/Environment_variable).
295
295
296
296
In many cases it's not very obvious how environment variables would be useful and applicable right away. But they keep showing up in many different scenarios when you are developing, so it's good to know about them.
**Typer** is <ahref="https://fastapi.tiangolo.com"class="external-link"target="_blank">FastAPI</a>'s little sibling.
7
+
**Typer** is [FastAPI](https://fastapi.tiangolo.com)'s little sibling.
8
8
9
9
It follows the same design and ideas. If you know **FastAPI**, you already know **Typer**... more or less.
10
10
11
11
## Just Modern Python
12
12
13
13
It's all based on standard **Python type** declarations. No new syntax to learn. Just standard modern Python.
14
14
15
-
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: <ahref="https://fastapi.tiangolo.com/python-types/"class="external-link"target="_blank">Python types intro</a>.
15
+
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: [Python types intro](https://fastapi.tiangolo.com/python-types/).
16
16
17
-
You will also see a 20 seconds refresher on the section [Tutorial - User Guide: First Steps](tutorial/first-steps.md){.internal-link target=_blank}.
17
+
You will also see a 20 seconds refresher on the section [Tutorial - User Guide: First Steps](tutorial/first-steps.md).
18
18
19
19
## Editor support
20
20
@@ -24,11 +24,11 @@ You will rarely need to come back to the docs.
24
24
25
25
Here's how your editor might help you:
26
26
27
-
* in <ahref="https://code.visualstudio.com/"class="external-link"target="_blank">Visual Studio Code</a>:
27
+
* in [Visual Studio Code](https://code.visualstudio.com/):
28
28
29
29

30
30
31
-
* in <ahref="https://www.jetbrains.com/pycharm/"class="external-link"target="_blank">PyCharm</a>:
31
+
* in [PyCharm](https://www.jetbrains.com/pycharm/):
0 commit comments