Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CLI apps with Typer - Python type annotations a...
Search
Sebastián Ramírez
October 10, 2022
Technology
440
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CLI apps with Typer - Python type annotations and shell completion
Sebastián Ramírez
October 10, 2022
More Decks by Sebastián Ramírez
See All by Sebastián Ramírez
What's new in FastAPI for AI
tiangolo
0
750
2025-10 PyCon Brasil keynote - Behind the scenes of FastAPI and friends for developers and builders
tiangolo
0
34
PyCon Taiwan Keynote - Behind the scenes of FastAPI and friends for developers and builders
tiangolo
0
230
Modern Python through FastAPI and friends - PyCon Sweden
tiangolo
0
79
Await for it: mixing async and blocking code - PyCon MEA - Dubai
tiangolo
0
68
Intro to FastAPI: Tips and Tricks for ML
tiangolo
1
400
Modern Python through FastAPI and friends - PyCon MEA - Dubai
tiangolo
0
900
Software de Colombia para el mundo
tiangolo
1
1.8k
Modern Python through FastAPI and friends - PyCon Indonesia
tiangolo
0
520
Other Decks in Technology
See All in Technology
AIレビューはどこまで任せられるのか?自動化と人が背負うレビューの境界
sansantech
PRO
3
1.1k
誤解だらけの開発生産性 / Myths and Misconceptions about Developer Productivity
i35_267
2
780
Amazon EVS で VCF 9.0 / 9.1 のサポート開始まとめ
mtoyoda
0
310
kintone の AI コワーカーを、 Anthropic にエージェントを"ホストさせて"作った話 #devkinmeetup
sugimomoto
0
110
カードゲーム作りが教えてくれた プロダクトオーナーシップ
moritamasami
0
110
インフラと開発の垣根を超えていき!〜元AWSインフラエンジニアがAWS開発で奮闘している話〜
hatahata021
3
300
Foxgloveについて 実際にExtensionを開発して公開するまでの話 / About Foxglove: The Story of Developing and Releasing an Extension
ry0_ka
0
290
公式ドキュメントの歩き方etc
coco_se
1
120
関数型の考えを TypeScript に持ち込んで、テストしやすい純粋関数を増やす / Pure at the Core, Effects at the Edge: Bringing Functional Thinking into TypeScript
kaminashi
2
130
CSに"SLO"は要らない、経営層に"99.9%"は伝わらない - SREを全社に"翻訳"する3原則
cscengineer
PRO
1
5k
型は壁、Rustでもバグを直すな、表現できなくせよ
nwiizo
14
2.1k
第67回コンピュータビジョン勉強会CVPR2026読会前編
tsukamotokenji
0
140
Featured
See All Featured
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Docker and Python
trallard
47
4k
The SEO Collaboration Effect
kristinabergwall1
1
500
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Technical Leadership for Architectural Decision Making
baasie
3
440
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
360
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
WCS-LA-2024
lcolladotor
0
710
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Transcript
CLI apps with type annotations and shell completion
Who am I? Sebastián Ramírez github.com/tiangolo linkedin.com/in/tiangolo twitter.com/tiangolo tiangolo.com Berlin,
Germany Senior Staff Software Engineer at I created: ➕ External Consultant for other teams
About Typer • 8K+ GitHub stars • FastAPI's little sibling
• Powered by Click @tiangolo
Command Line Interfaces (CLI) or Terminals @tiangolo • Text based
• You send program and parameters • Computer goes beep boop • Maybe output • Examples of CLI apps: git, ssh, pip
Simple function with type annotations @tiangolo
Simple function with type annotations @tiangolo
Why type annotations - error checks @tiangolo
Why type annotations - completion @tiangolo
Simple function with type annotations - recap @tiangolo
Simple scripts with Typer @tiangolo
Simple scripts - required arguments @tiangolo
Simple scripts with Typer - main block @tiangolo
Simple scripts - required arguments missing @tiangolo
Simple scripts with --help @tiangolo
Simple scripts - options @tiangolo
Simple scripts - invalid data @tiangolo
Simple scripts - more help @tiangolo
Simple scripts - more help in the terminal @tiangolo
Simple scripts - help for parameters @tiangolo
Simple scripts - help for parameters in the terminal @tiangolo
A Typer app @tiangolo
A Typer app - app object @tiangolo
A Typer app - decorator @tiangolo
A Typer app - call the app @tiangolo
A Typer app - supergreet @tiangolo
Install completion @tiangolo ✨ Works for everything: • Zsh •
Bash • Fish • PowerShell
Use completion @tiangolo
Use completion @tiangolo
Use completion @tiangolo
Use completion @tiangolo
Use completion @tiangolo
Completion @tiangolo 🧙 Works by default and can be used
for: • Deeply nested commands • CLI Options and CLI Arguments • Custom data (e.g. remote, from an API) • etc.
Commands @tiangolo
Commands - hi @tiangolo
Commands - bye @tiangolo
Help with commands @tiangolo
Commands - hi again @tiangolo
Commands --help for hi @tiangolo
Command hi in terminal @tiangolo
Commands - bye @tiangolo
Commands --help for bye @tiangolo
More Typer features @tiangolo • 🥅 Boolean flags • ❓
Prompts • 🔒 Ask passwords • 🚀 Launch apps (e.g. a browser) • ✅ Easy testing • ✨ More…
Thank you! Sebastián Ramírez tiangolo.com typer.tiangolo.com github.com/tiangolo linkedin.com/in/tiangolo twitter.com/tiangolo