Registry / devops / arguably

arguably

JSON →
library1.3.0pypypi✓ verified 84d ago

A Python CLI library that automatically generates argument parsers from function signatures. Current version 1.3.0, actively maintained with a focus on simplicity and type hint integration.

pip install arguably
INSTALL
IMPORT
SIG · ARGUABLY
A
arguably
devopspythonv1.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

arguably
import arguably
The library is imported directly as a module.

Define a CLI by decorating a function; run with `python script.py --name World`.

import arguably @arguably.command def hello(name: str, greeting: str = "Hello"): """Say hello to someone.""" print(f"{greeting}, {name}!") if __name__ == "__main__": arguably.run()
Debug
Known issues
breakingVersion 1.x changed the import path; previously `from arguably import ...` was required, now `import arguably` is the only correct way.
fix
Use `import arguably` instead of `from arguably import ...`.
affects: <1.0.0
gotchaType hints must be present for parameter parsing; omitting type hints may cause argparse to infer incorrectly (defaulting to str if not specified).
fix
Always include type hints for all parameters, even if using `str`.
affects: >=1.0.0
gotchaBoolean flags: use `bool` type hints with `*args` or `**kwargs` for optional flags; simple `flag: bool = False` may not work as expected.
fix
For boolean flags, use `--flag` as a store_true via `flag: bool = False`, but test behavior: arguably treats `bool` with default `False` as a store_true. If you need `--no-flag`, use a `store_false` pattern with `flag: bool = True`.
affects: >=1.0.0
deprecatedThe `@arguably.command` decorator with no parentheses is the current pattern; `@arguably.command()` (with parentheses) still works but is deprecated.
fix
Use `@arguably.command` (without parentheses) for new code.
affects: >=1.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'arguably'
Library not installed or installed in a different environment.
fix
Run `pip install arguably` in the correct Python environment.
TypeError: __init__() got an unexpected keyword argument 'name'
Using `@arguably.command` on a class method without proper handling (arguably does not support class/instance methods directly).
fix
Define standalone functions instead of methods; or use a class with `@staticmethod` decorators.
ValueError: Argument '--flag' uses store_true but type is <class 'str'>
Missing type hint or incorrect type hint for a boolean argument.
fix
Use `flag: bool = False` for store_true flags; ensure all parameters have valid type hints.
Upgrade
Version history
1.3.0latest on PyPI · released May 10, 2024
Audit
Dependencies
typing_extensionsoptionalUsed for type hint introspection in Python <3.11
Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
arguably — pip install arguably · libregistry