arcon
raw JSON → 0.4.0 verified Mon Apr 27 auth: no python
arcon is a Python library (v0.4.0) for persistent runtime configuration. It provides a CLI argument parser that can load defaults from a pyproject.toml file, reducing boilerplate. It requires Python >=3.8, <4.0 and is released on an irregular cadence.
pip install arcon Common errors
error AttributeError: module 'arcon' has no attribute 'ArgumentParser' ↓
cause Incorrect import: from arcon import arcon or import arcon.ArgumentParser
fix
Use: from arcon import ArgumentParser
error TypeError: __init__() got an unexpected keyword argument 'config' ↓
cause Trying to pass a config path directly to ArgumentParser (not supported) or using an older version.
fix
Check version; from arcon import ArgumentParser; parser = ArgumentParser() — config is handled automatically via pyproject.toml.
error arcon.exceptions.ArconConfigError: No pyproject.toml found ↓
cause No pyproject.toml in the project tree, or the file is not readable.
fix
Create a pyproject.toml at the project root, or use parser = ArgumentParser(pyproject=False) to disable config loading.
Warnings
gotcha Dashes in argument names are not supported; use underscores instead. ↓
fix Use underscores: --my-arg → my_arg
gotcha pyproject.toml must be in the current or parent directory; arcon walks up to the root. ↓
fix Ensure pyproject.toml is in the project root (the directory containing your script's parent).
gotcha Only simple types (str, int, float, bool) are supported for pyproject.toml defaults; complex types may cause silent failures. ↓
fix Use only simple types or override via command-line.
Imports
- ArgumentParser
from arcon import ArgumentParser
Quickstart
from arcon import ArgumentParser
parser = ArgumentParser()
parser.add_argument('--name', type=str, default='world')
args = parser.parse_args()
print(f"Hello, {args.name}!")