--- id: argbind version: "0.3.9" license: unclear license_treatment: permissive maintenance: dormant --- # argbind — Simple way to bind function arguments to the command line. License: permissive · Maintenance: dormant · Downloads: 428.2K/mo ## 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 above — 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 pip install argbind uv add argbind poetry add argbind ## Installing 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_current - Install friction: high - Maintenance: dormant - Downloads: 428.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags CLI from docstrings, command line argument binding, YAML configuration parser, function argument to CLI, scoped argument configuration, docstring-based CLI, configuration management, cli-generation, configuration-management, yaml-config [View on SkillFed](https://skillfed.io/packages/argbind) · [View on PyPI](https://pypi.org/project/argbind/)