argbind
Simple way to bind function arguments to the command line.
What it is and what it does
ArgBind is a lightweight CLI framework that generates command-line interfaces and configuration file support directly from Python function signatures and docstrings. Instead of writing separate argument parsers, you decorate functions with @argbind.bind(), and ArgBind automatically exposes their arguments as CLI flags (using a function.argument naming pattern) and loads them from YAML files. It depends on pyyaml for file I/O and docstring-parser to extract parameter documentation.
The package is designed for nested, scoped configuration—particularly useful in machine learning workflows where you might run the same function in different contexts (e.g., train vs. test scope) with different arguments. You can save execution configurations to YAML, reload them to reproduce runs, and override individual arguments from the command line. The entire library is intentionally small (~400 lines) and requires no external CLI framework, making it a minimal alternative to argparse for projects that value docstring-driven interfaces and YAML-based reproducibility.
Use it for:
- Configure ML experiments with nested YAML files and reproduce runs by loading saved configurations.
- Build multi-stage CLI programs where functions run in different scopes (train/test/eval) with scope-specific arguments.
- Migrate from argparse scripts without rewriting argument logic—bind existing functions and let ArgBind generate the CLI.
- Run the same function from CLI, Python scripts, and Jupyter notebooks using the same argument binding mechanism.
- Save and version experiment configurations as YAML for audit trails and easy parameter sweeps.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
ArgBind binds function and class arguments to command-line flags and YAML configuration files, automatically generating CLI interfaces from docstrings and type annotations with support for argument scoping.
Yes, if you are building a CLI for ML experiments or configuration-heavy scripts and prefer docstring-driven interfaces over traditional argument parsers. The permissive MIT license and zero security vulnerabilities are favorable. However, the package is dormant (last release May 2024, no commits since August 2024) and has high install friction—suitable only for projects where maintenance lag and source installation are acceptable trade-offs for simplicity and YAML-based reproducibility.
Install
argbind on PyPI
pip
pip install argbinduv
uv add argbindpoetry
poetry add argbindInstalling argbind
Before you install
Installation requires downloading from source (high friction). The package is dormant—last commit was 2024-08-11 with no releases since 2024-05-24, and it depends on pyyaml and docstring-parser, both stable libraries. Suitable for projects where maintenance lag is acceptable.
License in practice
Licensed under MIT (permissive), allowing unrestricted use, modification, and distribution in both open and closed projects with minimal obligations.
Quickstart
pip install argbind
import argbind
@argbind.bind()
def hello(name: str = 'world'):
"""Say hello.
Parameters
----------
name : str, optional
Who to greet, by default 'world'
"""
print(f"Hello {name}")
if __name__ == "__main__":
args = argbind.parse_args()
with argbind.scope(args):
hello()
Verify before relying
- Whether the package works reliably with Python versions beyond 3.8 (classifiers list 3.6–3.8 but requires_python allows up to 3.5–<4)
- Real-world stability and adoption beyond the stated 428153 monthly downloads (popularity tier top_15000)
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (<4,>=3.5) |
| Install friction | high — source build required |
| Runtime dependencies | 2 — pyyaml, docstring-parser |
| Maintenance | dormant — 812 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 428,153/month — #6,745 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: argbind-0.3.9.tar.gz
Keywords: command-line, configuration, yaml, argument, parsing
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
ConfigArgParseExtends Python's argparse to parse command-line…
permissive · top 1,000 on PyPI
clizeClize turns Python functions into command-line…
permissive · top 15,000 on PyPI
targGenerates a command-line interface from…
permissive · top 15,000 on PyPI
argparseProvides command-line argument parsing for…
permissive · top 1,000 on PyPI
typed-argument-parserA typed, modern replacement for Python's…
permissive · top 15,000 on PyPI
autocommandAutocommand converts a Python function into a…
copyleft · top 5,000 on PyPI
python-gflagsParses command-line flags and arguments for…
permissive · top 15,000 on PyPI
entrypoint2Converts Python function signatures and…
permissive · top 15,000 on PyPI
pydantic-argparseGenerates command-line argument parsers from…
permissive · top 5,000 on PyPI
multimethodMultimethod provides a decorator for adding…
permissive · top 5,000 on PyPI