Skip to content
Myr

:art: Tweak external links' format #36

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 GitHub · parents 9009a8d, fc90230 · Browse files · 22 files+67 added−63 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

22 files+67 added−63 removed

  • other:+67 added−63 removed

22 files+67 added−63 removed

modified:docs/css/custom.css+4 added
modified:docs/tutorial/multiple-values/options-with-multiple-values.md+1 added-1 removed
modified:docs/tutorial/options/name.md+1 added-1 removed
31 unmodified lines
3233Here you are passing the string `"--name"` as the second positional argument to `typer.Option()`.3435!!! info36 "<a href="https://docs.python.org/3.8/glossary.html#term-argument" target="_blank">Positional</a>" means that it's not a function argument with a keyword name.36 "<a href="https://docs.python.org/3.8/glossary.html#term-argument" class="external-link" target="_blank">Positional</a>" means that it's not a function argument with a keyword name.37 38 For example `show_default=True` is a keyword argument. "`show_default`" is the keyword.3940 But in `"--name"` there's no `option_name="--name"` or something similar, it's just the string value `"--name"` that goes in `typer.Option()` after the `...` value passed in the first position.
288 unmodified lines
modified:docs/tutorial/options/required.md+1 added-1 removed
modified:docs/tutorial/parameter-types/datetime.md+2 added-2 removed
1You can specify a *CLI parameter* as a Python <a href="https://docs.python.org/3/library/datetime.html" target="_blank">`datetime`</a>.1You can specify a *CLI parameter* as a Python <a href="https://docs.python.org/3/library/datetime.html" class="external-link" target="_blank">`datetime`</a>.23Your function will receive a standard Python `datetime` object, and again, your editor will give you completion, etc.45```Python hl_lines="1 6 7 8"
35 unmodified lines
41## Custom date format4243You can also customize the formats received for the `datetime` with the `formats` parameter.4445`formats` receives a list of strings with the date formats that would be passed to <a href="https://docs.python.org/3/library/datetime.html#datetime.date.strftime" target="_blank">datetime.strptime()</a>.45`formats` receives a list of strings with the date formats that would be passed to <a href="https://docs.python.org/3/library/datetime.html#datetime.date.strftime" class="external-link" target="_blank">datetime.strptime()</a>.4647For example, let's imagine that you want to accept an ISO formatted datetime, but for some strange reason, you also want to accept a format with:4849* first the month
30 unmodified lines
modified:docs/tutorial/parameter-types/enum.md+1 added-1 removed
1To define a *CLI parameter* that can take a value from a predefined set of values you can use a standard Python <a href="https://docs.python.org/3/library/enum.html" target="_blank">`enum.Enum`</a>:1To define a *CLI parameter* that can take a value from a predefined set of values you can use a standard Python <a href="https://docs.python.org/3/library/enum.html" class="external-link" target="_blank">`enum.Enum`</a>:23```Python hl_lines="1 6 7 8 9 12 13"4{!./src/parameter_types/enum/tutorial001.py!}5```
63 unmodified lines
modified:docs/tutorial/parameter-types/file.md+3 added-3 removed
3 unmodified lines
4 In most of the cases you are probably fine just using `Path`.56 You can read and write data with `Path` the same way.78The difference is that these types will give you a Python <a href="https://docs.python.org/3/glossary.html#term-file-object" target="_blank">file-like object</a> instead of a Python <a href="https://docs.python.org/3/library/pathlib.html#basic-use" target="_blank">Path</a>.8The difference is that these types will give you a Python <a href="https://docs.python.org/3/glossary.html#term-file-object" class="external-link" target="_blank">file-like object</a> instead of a Python <a href="https://docs.python.org/3/library/pathlib.html#basic-use" class="external-link" target="_blank">Path</a>.910A "file-like object" is the same type of object returned by `open()` as in:1112```Python
154 unmodified lines
167## File *CLI parameter* configurations168169You can use several configuration parameters for these types (classes) in `typer.Option()` and `typer.Argument()`:170171* `mode`: controls the "<a href="https://docs.python.org/3/library/functions.html#open" target="_blank">mode</a>" to open the file with.171* `mode`: controls the "<a href="https://docs.python.org/3/library/functions.html#open" class="external-link" target="_blank">mode</a>" to open the file with.172 * It's automatically set for you by using the classes above.173 * Read more about it below.174* `encoding`: to force a specific encoding, e.g. `"utf-8"`.175* `lazy`: delay <abbr title="input and output, reading and writing files">I/O</abbr> operations. Automatic by default.
1 unmodified line
177* `atomic`: if true, all writes will actually go to a temporal file and then moved to the final destination after completing. This is useful with files modified frequently by several users/programs.178179## Advanced `mode`180181By default, **Typer** will configure the <a href="https://docs.python.org/3/library/functions.html#open" target="_blank">`mode`</a> for you:181By default, **Typer** will configure the <a href="https://docs.python.org/3/library/functions.html#open" class="external-link" target="_blank">`mode`</a> for you:182183* `typer.FileText`: `mode="r"`, to read text.184* `typer.FileTextWrite`: `mode="w"`, to write text.185* `typer.FileBinaryRead`: `mode="rb"`, to read binary data.
63 unmodified lines
modified:docs/tutorial/parameter-types/index.md+1 added-1 removed
60 unmodified lines
61See more about specific types and validations in the next sections...626364!!! info "Technical Details"65 All the types you will see in the next sections are handled underneath by <a href="https://click.palletsprojects.com/en/7.x/parameters/#parameter-types" target="_blank">Click's Parameter Types</a>.65 All the types you will see in the next sections are handled underneath by <a href="https://click.palletsprojects.com/en/7.x/parameters/#parameter-types" class="external-link" target="_blank">Click's Parameter Types</a>.
modified:docs/tutorial/parameter-types/path.md+2 added-2 removed
1You can declare a *CLI parameter* to be a standard Python <a href="https://docs.python.org/3/library/pathlib.html#basic-use" target="_blank">`pathlib.Path`</a>.1You can declare a *CLI parameter* to be a standard Python <a href="https://docs.python.org/3/library/pathlib.html#basic-use" class="external-link" target="_blank">`pathlib.Path`</a>.23This is what you would do for directory paths, file paths, etc:45```Python hl_lines="1 6"
48 unmodified lines
54!!! note "Technical Details"55 It will not expand a tilde-prefix (something with `~`, like `~/Documents/`), as this is supposed to be done by the shell only.5657!!! tip58 All these parameters come directly from <a href="https://click.palletsprojects.com/en/7.x/parameters/#parameter-types" target="_blank">Click</a>.58 All these parameters come directly from <a href="https://click.palletsprojects.com/en/7.x/parameters/#parameter-types" class="external-link" target="_blank">Click</a>.5960For example:6162```Python hl_lines="9 10 11 12 13 14"
43 unmodified lines
modified:docs/tutorial/parameter-types/uuid.md+2 added-2 removed
1!!! info2 A UUID is a <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier" target="_blank">"Universally Unique Identifier"</a>.2 A UUID is a <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier" class="external-link" target="_blank">"Universally Unique Identifier"</a>.34 It's a standard format for identifiers, like passport numbers, but for anything, not just people in countries.56 They look like this:
15 unmodified lines
22```Python hl_lines="1 6 7 8"23{!./src/parameter_types/uuid/tutorial001.py!}24```2526Your Python code will receive a standard Python <a href="https://docs.python.org/3.8/library/uuid.html" target="_blank">`UUID`</a> object with all its attributes and methods, and as you are annotating your function parameter with that type, you will have type checks, autocompletion in your editor, etc.26Your Python code will receive a standard Python <a href="https://docs.python.org/3.8/library/uuid.html" class="external-link" target="_blank">`UUID`</a> object with all its attributes and methods, and as you are annotating your function parameter with that type, you will have type checks, autocompletion in your editor, etc.2728Check it:2930<div class="termy">
18 unmodified lines
modified:docs/tutorial/subcommands/callback-override.md+1 added-1 removed
49 unmodified lines
50## Overriding the callback on creation5152If a callback was added when creating the `typer.Typer()` app, it's possible to override it with a new one using `@app.callback()`.5354This is the same information you saw on the section about <a href="https://typer.tiangolo.com/tutorial/commands/callback/" target="_blank">Commands - Typer Callback</a>, and it applies the same for sub-Typer apps:54This is the same information you saw on the section about <a href="https://typer.tiangolo.com/tutorial/commands/callback/" class="external-link" target="_blank">Commands - Typer Callback</a>, and it applies the same for sub-Typer apps:5556```Python hl_lines="6 7 10 14 15 16"57{!./src/subcommands/callback_override/tutorial003.py!}58```
46 unmodified lines
modified:docs/tutorial/subcommands/index.md+1 added-1 removed
1You read before how to create a program with <a href="https://typer.tiangolo.com/tutorial/commands/" target="_blank">Commands</a>.1You read before how to create a program with <a href="https://typer.tiangolo.com/tutorial/commands/" class="external-link" target="_blank">Commands</a>.23Now we'll see how to create a *CLI program* with commands that have their own subcommands. Also known as command groups.45For example, the *CLI program* `git` has a command `remote`.
34 unmodified lines
modified:docs/tutorial/app-dir.md+1 added-1 removed
30 unmodified lines
31If the first element is a `Path` object the next ones (after the `/`) can be `str`.3233And it will create a new `Path` object from that.3435If you want a quick guide on using `Path()` you can check <a href="https://realpython.com/python-pathlib/" target="_blank">this post on Real Python</a> or <a href="https://treyhunner.com/2018/12/why-you-should-be-using-pathlib/" target="_blank">this post by Trey Hunner</a>.35If you want a quick guide on using `Path()` you can check <a href="https://realpython.com/python-pathlib/" class="external-link" target="_blank">this post on Real Python</a> or <a href="https://treyhunner.com/2018/12/why-you-should-be-using-pathlib/" class="external-link" target="_blank">this post by Trey Hunner</a>.3637In the code above, we are also explicitly declaring `config_path` as having type `Path` to help the editor provide completion and type checks:3839```Python
4 unmodified lines
modified:docs/tutorial/arguments.md+3 added-3 removed
33 unmodified lines
34</div>3536### An alternative *CLI argument* declaration3738In the <a href="https://typer.tiangolo.com/tutorial/first-steps/#add-a-cli-argument" target="_blank">First Steps</a> you saw how to add a *CLI argument*:38In the <a href="https://typer.tiangolo.com/tutorial/first-steps/#add-a-cli-argument" class="external-link" target="_blank">First Steps</a> you saw how to add a *CLI argument*:3940```Python hl_lines="4"41{!./src/first_steps/tutorial002.py!}42```
26 unmodified lines
6970To make it *required*, we pass `...` as the first function argument passed to `typer.Argument(...)`.7172!!! info73 If you hadn't seen that `...` before: it is a a special single value, it is <a href="https://docs.python.org/3/library/constants.html#Ellipsis" target="_blank">part of Python and is called "Ellipsis"</a>.73 If you hadn't seen that `...` before: it is a a special single value, it is <a href="https://docs.python.org/3/library/constants.html#Ellipsis" class="external-link" target="_blank">part of Python and is called "Ellipsis"</a>.7475All we did there achieves the same thing as before, a **required** *CLI argument*:7677<div class="termy">
112 unmodified lines
190For that reason, Typer (actually Click underneath) doesn't attempt to automatically document *CLI arguments*.191192And you should document them as part of the CLI app documentation, normally in a <abbr title="a multi-line string as the first expression inside a function (not assigned to any variable) used for documentation">docstring</abbr>.193194Check the last example from the <a href="https://typer.tiangolo.com/tutorial/first-steps/#document-your-cli-app" target="_blank">First Steps</a>:194Check the last example from the <a href="https://typer.tiangolo.com/tutorial/first-steps/#document-your-cli-app" class="external-link" target="_blank">First Steps</a>:195196```Python hl_lines="5 6 7 8 9"197{!./src/first_steps/tutorial006.py!}198```
10 unmodified lines
modified:docs/tutorial/index.md+1 added-1 removed
1## Python types23If 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>.45You can also check the <a href="https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html" target="_blank">mypy cheat sheet</a>.5You can also check the <a href="https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html" class="external-link" target="_blank">mypy cheat sheet</a>.67In short (very short), you can declare a function with parameters like:89```Python
67 unmodified lines
modified:docs/tutorial/printing.md+3 added-3 removed
5 unmodified lines
67The reason to use `typer.echo()` instead of just `print()` is that it applies some error corrections in case the terminal is misconfigured, and it will properly output color if it's supported.89!!! info10 `typer.echo()` comes directly from Click, you can read more about it in <a href="https://click.palletsprojects.com/en/7.x/quickstart/#echoing" target="_blank">Click's docs</a>.10 `typer.echo()` comes directly from Click, you can read more about it in <a href="https://click.palletsprojects.com/en/7.x/quickstart/#echoing" class="external-link" target="_blank">Click's docs</a>.1112Check it:1314<div class="termy">
8 unmodified lines
2324## Color2526!!! info27 For colors to work correctly on Windows you need to also install <a href="https://pypi.org/project/colorama/" target="_blank">`colorama`</a>.27 For colors to work correctly on Windows you need to also install <a href="https://pypi.org/project/colorama/" class="external-link" target="_blank">`colorama`</a>.2829 You don't need to call `colorama.init()`. Typer (actually Click) will handle it underneath.3031!!! note "Technical Details"
32 unmodified lines
64* `reverse`: enable or disable inverse rendering (foreground becomes background and the other way round).65* `reset`: by default a reset-all code is added at the end of the string which means that styles do not carry over. This can be disabled to compose styles.6667!!! info68 You can read more about it in <a href="https://click.palletsprojects.com/en/7.x/api/#click.style" target="_blank">Click's docs about `style()`</a>68 You can read more about it in <a href="https://click.palletsprojects.com/en/7.x/api/#click.style" class="external-link" target="_blank">Click's docs about `style()`</a>6970## `typer.secho()` - style and print7172There's a shorter form to style and print at the same time with `typer.secho()` it's like `typer.echo()` but also adds style like `typer.style()`:
11 unmodified lines
modified:docs/tutorial/progressbar.md+1 added-1 removed
82 unmodified lines
83</div>8485### About the function with `yield`8687If you hadn't seen something like that `yield` above, that's a "<a href="https://docs.python.org/3/glossary.html#term-generator" target="_blank">generator</a>".87If you hadn't seen something like that `yield` above, that's a "<a href="https://docs.python.org/3/glossary.html#term-generator" class="external-link" target="_blank">generator</a>".8889You can iterate over that function with a `for` and at each iteration it will give you the value at `yield`.9091`yield` is like a `return` that gives values multiple times and let's you use the function in a `for` loop.
48 unmodified lines
modified:docs/tutorial/prompt.md+2 added-2 removed
1When you need to ask the user for info interactively you should normally use <a href="https://typer.tiangolo.com/tutorial/options/prompt/" target="_blank">*CLI Option*s with Prompt</a>, because they allow using the CLI program in a non-interactive way (for example, a Bash script could use it).1When you need to ask the user for info interactively you should normally use <a href="https://typer.tiangolo.com/tutorial/options/prompt/" class="external-link" target="_blank">*CLI Option*s with Prompt</a>, because they allow using the CLI program in a non-interactive way (for example, a Bash script could use it).23But if you absolutely need to ask for interactive information without using a *CLI option*, you can use `typer.prompt()`:45```Python hl_lines="5"
15 unmodified lines
21</div>2223## Confirm2425There's also an alternative to ask for confirmation. Again, if possible, you should use a <a href="https://typer.tiangolo.com/tutorial/options/prompt/" target="_blank">*CLI Option* with a confirmation prompt</a>:25There's also an alternative to ask for confirmation. Again, if possible, you should use a <a href="https://typer.tiangolo.com/tutorial/options/prompt/" class="external-link" target="_blank">*CLI Option* with a confirmation prompt</a>:2627```Python hl_lines="5"28{!./src/prompt/tutorial002.py!}29```
49 unmodified lines
modified:docs/features.md+3 added-3 removed
18 unmodified lines
19You will rarely need to come back to the docs.2021Here's how your editor might help you:2223* in <a href="https://code.visualstudio.com/" target="_blank">Visual Studio Code</a>:23* in <a href="https://code.visualstudio.com/" class="external-link" target="_blank">Visual Studio Code</a>:2425![editor support](img/vscode-completion.png)2627* in <a href="https://www.jetbrains.com/pycharm/" target="_blank">PyCharm</a>:27* in <a href="https://www.jetbrains.com/pycharm/" class="external-link" target="_blank">PyCharm</a>:2829![editor support](img/pycharm-completion.png)3031You will get completion for everything. That's something no other CLI library provides right now.
27 unmodified lines
59 Then you can tell the user to run that command and the rest will just work.6061## The power of Click6263<a href="https://click.palletsprojects.com" target="_blank">Click</a> is one of the most popular tools for building CLIs in Python.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.6465**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.
10 unmodified lines
modified:docs/help-typer.md+17 added-17 removed
8 unmodified lines
9And there are several ways to get help too.1011## Star **Typer** in GitHub1213You 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>.13You can "star" Typer in GitHub (clicking the star button at the top right): <a href="https://github.com/tiangolo/typer" class="external-link" target="_blank">https://github.com/tiangolo/typer</a>.1415By adding a star, other users will be able to find it more easily and see that it has been already useful for others.1617## Watch the GitHub repository for releases1819You 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>.19You can "watch" Typer in GitHub (clicking the "watch" button at the top right): <a href="https://github.com/tiangolo/typer" class="external-link" target="_blank">https://github.com/tiangolo/typer</a>.2021There you can select "Releases only".2223Doing 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.2425## Connect with the author2627You can connect with <a href="https://tiangolo.com" target="_blank">me (Sebastián Ramírez / `tiangolo`)</a>, the author.27You can connect with <a href="https://tiangolo.com" class="external-link" target="_blank">me (Sebastián Ramírez / `tiangolo`)</a>, the author.2829You can:3031* <a href="https://github.com/tiangolo" target="_blank">Follow me on **GitHub**</a>.31* <a href="https://github.com/tiangolo" class="external-link" 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>.34* <a href="https://twitter.com/tiangolo" class="external-link" 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>.37* <a href="https://www.linkedin.com/in/tiangolo/" class="external-link" 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>.43 * On <a href="https://dev.to/tiangolo" class="external-link" target="_blank">**Dev.to**</a>.44 * On <a href="https://medium.com/@tiangolo" class="external-link" target="_blank">**Medium**</a>.4546## Tweet about **Typer**4748<a href="https://twitter.com/compose/tweet?text=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.48<a href="https://twitter.com/compose/tweet?text=I'm loving Typer because... https://github.com/tiangolo/typer cc @tiangolo" class="external-link" target="_blank">Tweet about **Typer**</a> and let me and others know why you like it.4950## Let me know how are you using **Typer**5152I love to hear about how **Typer** is being used, what have you liked in it, in which project/company you are using it, etc.5354You can let me know:5556* <a href="https://twitter.com/compose/tweet?text=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>.56* <a href="https://twitter.com/compose/tweet?text=Hey @tiangolo, I'm using Typer at..." class="external-link" target="_blank">On **Twitter**</a>.57* <a href="https://www.linkedin.com/in/tiangolo/" class="external-link" target="_blank">On **Linkedin**</a>.58* <a href="https://dev.to/tiangolo" class="external-link" target="_blank">On **Dev.to**</a>.59* <a href="https://medium.com/@tiangolo" class="external-link" target="_blank">On **Medium**</a>.6061## Help others with issues in GitHub6263You can see <a href="https://github.com/tiangolo/typer/issues" target="_blank">existing issues</a> and try and help others.63You can see <a href="https://github.com/tiangolo/typer/issues" class="external-link" target="_blank">existing issues</a> and try and help others.6465## Watch the GitHub repository6667You 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>.67You can "watch" Typer in GitHub (clicking the "watch" button at the top right): <a href="https://github.com/tiangolo/typer" class="external-link" target="_blank">https://github.com/tiangolo/typer</a>.6869If you select "Watching" instead of "Releases only", you will receive notifications when someone creates a new issue.7071Then you can try and help them solving those issues.7273## Create issues7475You 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:75You can <a href="https://github.com/tiangolo/typer/issues/new/choose" class="external-link" target="_blank">create a new issue</a> in the GitHub repository, for example to:7677* Report a bug/issue.78* Suggest a new feature.79* Ask a question.8081## Create a Pull Request8283You can <a href="https://github.com/tiangolo/typer" target="_blank">create a Pull Request</a>, for example:83You can <a href="https://github.com/tiangolo/typer" class="external-link" target="_blank">create a Pull Request</a>, for example:8485* To fix a typo you found on the documentation.86* To propose new documentation sections.87* To fix an existing issue/bug.
5 unmodified lines
modified:docs/index.md+8 added-8 removed
38 unmodified lines
39## Requirements4041Python 3.6+4243Typer stands on the shoulders of a giant. Its only internal dependency is <a href="https://click.palletsprojects.com/" target="_blank">Click</a>.43Typer stands on the shoulders of a giant. Its only internal dependency is <a href="https://click.palletsprojects.com/" class="external-link" target="_blank">Click</a>.4445## Installation4647<div class="termy">
198 unmodified lines
246For a more complete example including more features, see the <a href="https://typer.tiangolo.com/tutorial/intro/">Tutorial - User Guide</a>.247248## Optional Dependencies249250Typer uses <a href="https://click.palletsprojects.com/" target="_blank">Click</a> internally. That's the only dependency.250Typer uses <a href="https://click.palletsprojects.com/" class="external-link" target="_blank">Click</a> internally. That's the only dependency.251252But you can also install extras:253254* <a href="https://pypi.org/project/colorama/" target="_blank"><code>colorama</code></a>: and Click will automatically use it to make sure your terminal's colors always work correctly, even in Windows.254* <a href="https://pypi.org/project/colorama/" class="external-link" target="_blank"><code>colorama</code></a>: and Click will automatically use it to make sure your terminal's colors always work correctly, even in Windows.255 * Then you can use any tool you want to output your terminal's colors in all the systems, including the integrated `typer.style()` and `typer.secho()` (provided by Click).256 * 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>.257* <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.256 * Or any other tool, e.g. <a href="https://pypi.org/project/wasabi/" class="external-link" target="_blank"><code>wasabi</code></a>, <a href="https://github.com/erikrose/blessings" class="external-link" target="_blank"><code>blessings</code></a>.257* <a href="https://github.com/click-contrib/click-completion" class="external-link" target="_blank"><code>click-completion</code></a>: and Typer will automatically configure it to provide completion for all the shells, including installation commands.258259You can install `typer` with `colorama` and `click-completion` with `pip install typer[all]`.260261## Other tools and plug-ins
1 unmodified line
263Click 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.264265For example:266267* <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.268 * There are several other Click plug-ins at <a href="https://github.com/click-contrib" target="_blank">click-contrib</a> that you can explore.269* <a href="https://pypi.org/project/tabulate/" target="_blank"><code>tabulate</code></a>: to automatically display tabular data nicely. Independent of Click or typer.267* <a href="https://github.com/click-contrib/click-spinner" class="external-link" target="_blank"><code>click-spinner</code></a>: to show the user that you are loading data. A Click plug-in.268 * There are several other Click plug-ins at <a href="https://github.com/click-contrib" class="external-link" target="_blank">click-contrib</a> that you can explore.269* <a href="https://pypi.org/project/tabulate/" class="external-link" target="_blank"><code>tabulate</code></a>: to automatically display tabular data nicely. Independent of Click or typer.270* etc... you can re-use many of the great available tools for building CLIs.271272## License273
1 unmodified line
modified:README.md+8 added-8 removed
38 unmodified lines
39## Requirements4041Python 3.6+4243Typer stands on the shoulders of a giant. Its only internal dependency is <a href="https://click.palletsprojects.com/" target="_blank">Click</a>.43Typer stands on the shoulders of a giant. Its only internal dependency is <a href="https://click.palletsprojects.com/" class="external-link" target="_blank">Click</a>.4445## Installation4647<div class="termy">
198 unmodified lines
246For a more complete example including more features, see the <a href="https://typer.tiangolo.com/tutorial/intro/">Tutorial - User Guide</a>.247248## Optional Dependencies249250Typer uses <a href="https://click.palletsprojects.com/" target="_blank">Click</a> internally. That's the only dependency.250Typer uses <a href="https://click.palletsprojects.com/" class="external-link" target="_blank">Click</a> internally. That's the only dependency.251252But you can also install extras:253254* <a href="https://pypi.org/project/colorama/" target="_blank"><code>colorama</code></a>: and Click will automatically use it to make sure your terminal's colors always work correctly, even in Windows.254* <a href="https://pypi.org/project/colorama/" class="external-link" target="_blank"><code>colorama</code></a>: and Click will automatically use it to make sure your terminal's colors always work correctly, even in Windows.255 * Then you can use any tool you want to output your terminal's colors in all the systems, including the integrated `typer.style()` and `typer.secho()` (provided by Click).256 * 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>.257* <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.256 * Or any other tool, e.g. <a href="https://pypi.org/project/wasabi/" class="external-link" target="_blank"><code>wasabi</code></a>, <a href="https://github.com/erikrose/blessings" class="external-link" target="_blank"><code>blessings</code></a>.257* <a href="https://github.com/click-contrib/click-completion" class="external-link" target="_blank"><code>click-completion</code></a>: and Typer will automatically configure it to provide completion for all the shells, including installation commands.258259You can install `typer` with `colorama` and `click-completion` with `pip install typer[all]`.260261## Other tools and plug-ins
1 unmodified line
263Click 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.264265For example:266267* <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.268 * There are several other Click plug-ins at <a href="https://github.com/click-contrib" target="_blank">click-contrib</a> that you can explore.269* <a href="https://pypi.org/project/tabulate/" target="_blank"><code>tabulate</code></a>: to automatically display tabular data nicely. Independent of Click or typer.267* <a href="https://github.com/click-contrib/click-spinner" class="external-link" target="_blank"><code>click-spinner</code></a>: to show the user that you are loading data. A Click plug-in.268 * There are several other Click plug-ins at <a href="https://github.com/click-contrib" class="external-link" target="_blank">click-contrib</a> that you can explore.269* <a href="https://pypi.org/project/tabulate/" class="external-link" target="_blank"><code>tabulate</code></a>: to automatically display tabular data nicely. Independent of Click or typer.270* etc... you can re-use many of the great available tools for building CLIs.271272## License273
1 unmodified line