plac: more than just another command-line arguments parser
summary
Creates a command-line interface directly from a Python function signature so a one-line CLI from a function signature generates parsing, help and usage; uses Python 3 annotations and inspect to provide annotation-driven type conversion and choice/flag handling; builds a subcommand shell that records and replays interactions for tests, exposed as a subcommand shell with test recording; runs long tasks in separate processes so jobs are killable and nonblocking, implemented as multiprocess cancellable jobs that are demonstrated working.
AI-written summary · about
chapters (12)
- 0:00plac introduction
- 3:59Basic argument parsing
- 5:56Simplify with plac
- 11:10Custom messages and styles
- 19:14Advanced options
- 23:30Numeric values and errors
- 29:56Subcommands and factories
- 35:32Custom commands
- 40:49Testing command interactions
- 47:20Long tasks responsiveness
- 53:19Multiprocessing tasks
- 58:19Why plac was created
related talks
29mBuilding Nice Command Line Interfaces — A Look Beyond the stdlib
01h 26mPackage Your Python Code as a CLI
27mCommand line programs for busy developers
37mLet's Make Better Command Line Applications
33mAwesome Commandline Tools
27mHow to Write a Great Command Line Application
25mThe Hitchhiker's Guide to CLIs in Python
33mUpgrading Python CLIs From Scripts to Interactive Tools
