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
0
330
CLI apps with Typer - Python type annotations and shell completion
Sebastián Ramírez
October 10, 2022
Tweet
Share
More Decks by Sebastián Ramírez
See All by Sebastián Ramírez
Modern Python through FastAPI and friends - PyCon Sweden
tiangolo
0
41
Await for it: mixing async and blocking code - PyCon MEA - Dubai
tiangolo
0
22
Intro to FastAPI: Tips and Tricks for ML
tiangolo
1
310
Modern Python through FastAPI and friends - PyCon MEA - Dubai
tiangolo
0
880
Software de Colombia para el mundo
tiangolo
1
1.7k
Modern Python through FastAPI and friends - PyCon Indonesia
tiangolo
0
490
Modern Python through FastAPI and friends - Dubai - AI Everything - Gitex
tiangolo
0
98
Modern Python through FastAPI and friends - PyCon India
tiangolo
1
310
Haz un servicio de ML fácilmente con FastAPI
tiangolo
0
460
Other Decks in Technology
See All in Technology
JuliaTokaiとJuliaLangJaの紹介 for NGK2025S
antimon2
1
150
2025/1/29 BigData-JAWS 勉強会 #28 (re:Invent 2024 re:Cap)/new-feature-preview-q-in-quicksight-scenarios-tried-and-tested
emiki
0
170
今年一年で頑張ること / What I will do my best this year
pauli
1
240
クロスアカウントな RDS Snapshot Export による カジュアルなデータ集約の仕組み / 202501-finatext-technight-lt
wa6sn
1
110
Platform EngineeringがあればSREはいらない!? 新時代のSREに求められる役割とは
mshibuya
1
1.8k
Building Scalable Backend Services with Firebase
wisdommatt
0
110
プロダクト開発、インフラ、コーポレート、そしてAIとの共通言語としての Terraform / Terraform as a Common Language for Product Development, Infrastructure, Corporate Engineering, and AI
yuyatakeyama
5
610
信頼性を支えるテレメトリーパイプラインの構築 / Building Telemetry Pipeline with OpenTelemetry
ymotongpoo
8
2.5k
ドメイン駆動設計によるdodaダイレクトのリビルド実践 / Rebuild practice of doda direct with domain-driven design
techtekt
0
190
RevOpsへ至る道 データ活用による事業革新への挑戦 / path-to-revops
pei0804
1
130
[SRE kaigi 2025] ガバメントクラウドに向けた開発と変化するSRE組織のあり方 / Development for Government Cloud and the Evolving Role of SRE Teams
kazeburo
3
1k
コロプラのオンボーディングを採用から語りたい
colopl
6
1.5k
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Producing Creativity
orderedlist
PRO
343
39k
Mobile First: as difficult as doing things right
swwweet
222
9k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Making the Leap to Tech Lead
cromwellryan
133
9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
Gamification - CAS2011
davidbonilla
80
5.1k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Thoughts on Productivity
jonyablonski
68
4.4k
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