plac
The smartest command line arguments parser in the world
Decision gist · record as of 2026-08-14
Yes. Plac is stable, dependency-free, actively maintained, and solves a real problem—turning functions into CLIs with minimal code. It's ideal for scripts, prototypes, and tools where you want argument parsing without the verbosity of argparse. The permissive BSD license and low install friction make it a low-risk addition. Consider it if you're building CLI tools and want to keep boilerplate minimal.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with no runtime dependencies beyond the standard library.
- Actively maintained with recent commits and stable production status.
License · maintenance · safety
BSD License (permissive) — BSD License is permissive; you can use, modify, and distribute plac freely in commercial and open-source projects with minimal restrictions.
last release 2025-04-04 (497 days) · last repo commit 2026-07-20 · 303 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,178,574 downloads/mo, #3,229 on PyPI
Alternatives
Verify before relying
import plac
def main(model, iter=100, debug=False):
"""A script for machine learning"""
print(model, iter, debug)
if __name__ == '__main__':
plac.call(main)- Whether plac's single-file design (plac_core.py) is suitable for vendoring into production codebases at scale
- Performance characteristics when handling large numbers of arguments or complex nested command structures
What it is and what it does
Plac is a command-line argument parser that infers CLI structure directly from Python function signatures. Instead of writing separate argument-parsing code, you decorate a function and plac automatically generates help text, validates inputs, and maps command-line arguments to function parameters. It works across Python 2.6 through modern Python 3 versions and has no external dependencies—the core functionality lives in a single module that can be embedded in your own code if needed.
The package is designed for developers who want minimal boilerplate when building CLI tools. You can use simple function signatures for basic cases, or apply decorators (@plac.pos, @plac.opt, @plac.flg) for finer control over positional arguments, options, and flags. It handles variable arguments (*args, **kwds) and supports features like argument choices, type conversion, and help text generation from docstrings.
Use it for
- Build a simple CLI script from a Python function without writing argparse boilerplate
- Generate help and usage messages automatically from function signatures and docstrings
- Create command-line tools that accept positional arguments, options, and flags with minimal decorator overhead
- Embed plac_core.py directly in a package to eliminate external CLI dependencies
- Prototype command-line interfaces quickly during development or data analysis workflows
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Plac is stable, dependency-free, actively maintained, and solves a real problem—turning functions into CLIs with minimal code. It's ideal for scripts, prototypes, and tools where you want argument parsing without the verbosity of argparse. The permissive BSD license and low install friction make it a low-risk addition. Consider it if you're building CLI tools and want to keep boilerplate minimal.
Install
plac on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies beyond the standard library. Actively maintained with recent commits and stable production status.
License in practice
BSD License is permissive; you can use, modify, and distribute plac freely in commercial and open-source projects with minimal restrictions.
Quickstart
import plac
def main(model, iter=100, debug=False):
"""A script for machine learning"""
print(model, iter, debug)
if __name__ == '__main__':
plac.call(main)
Verify before relying
- Whether plac's single-file design (plac_core.py) is suitable for vendoring into production codebases at scale
- Performance characteristics when handling large numbers of arguments or complex nested command structures
Package facts
| License | BSD License permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 497 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,178,574 / month, #3,229 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: LibrariesTopic :: Utilities |
Evidence: plac-1.4.5-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “zero-dependency CLI tool”
- placPlac generates command-line interfaces from Python function…
- runezA zero-dependency utility library providing common file operations,…
- warchant_dc_schemaGenerates JSON Schema (2020-12 draft) from Python dataclasses with no…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also autocommand · pydantic-argparse · entrypoint2 · mando · decli · parameter-decorators · argparse · typed-argument-parser · argparse-dataclass · clize