~/talk

Package Your Python Code as a CLI

Talkat PyData London 2025 · on Friday, 2025-06-06· at 11:00· Hardwick Hub· [developer-experience]
links:none on file
slides:none on file

Shows exactly how to turn a Python script into a CLI: copy code, pick arguments, read from stdin/stdout, add a shebang, chmod +x and put the file on PATH, then optionally replace sys.argv with argparse or Typer. Demonstrates a greet_simple example, explains piping and streams, and uses sys.argv → argparse → Typer for progressively richer interfaces. Covers making standalone tools with PEP 723 + UV for self-contained scripts and highlights autogenerated help, virtualenv-per-script behavior, and practical interface design.

AI-written summary · about

  1. 0:00Packaging Python as CLI
  2. 2:52Python CLI tools
  3. 11:28Scripts to CLI tools
  4. 35:43Designing CLI interfaces
  5. 54:13Six steps to executable script
  6. 1:04:56Advanced argparse features
  7. 1:17:55Typer and PEP 723
  8. 1:25:13CLI tools best practices
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.