Registry / serialization / coqpit-config

coqpit-config

JSON →
library0.2.5pypypi✓ verified 90d ago

A simple, light-weight configuration management library that uses Python dataclasses. Version 0.2.5 supports Python >=3.10, Literal types, and CLI argument parsing. Released as needed; maintained by the Idiap research institute.

pip install coqpit-config
INSTALL
IMPORT
SIG · COQPIT-CONFIG
C
coqpit-config
serializationpythonv0.2.5
Install
1.6s avg
Import
140ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.2.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.148s · 18.2MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.132s · 19MB
16MB installed
● package 16MB
Code
Verified usage

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

Coqpit
✓ from coqpit import Coqpit

Define a config dataclass by inheriting from Coqpit, then instantiate and use.

from dataclasses import dataclass from coqpit import Coqpit @dataclass class MyConfig(Coqpit): name: str = "default" count: int = 1 config = MyConfig() print(config.to_dict())
Debug
Known issues
breakingv0.2.0 raises TypeError if config field value does not match declared type.
fix
Ensure all field values conform to the declared type annotation.
affects: >=0.2.0
gotchaCoqpit's has() method only returns True for predefined fields (set in __annotations__). Dynamically set attributes via setattr may cause has() to return False, and get() may fail.
fix
Always define fields in the class body; avoid dynamic attribute assignment.
affects: >=0.2.3
gotchaInitializing a Coqpit class with positional arguments is deprecated. Always use keyword arguments.
fix
Use keyword arguments: MyConfig(name='test', count=2) instead of MyConfig('test', 2).
affects: all
Errors
Common errors & fixes
TypeError: __init__() got multiple values for argument 'name'
Passing both positional and keyword argument for the same field.
fix
Use only keyword arguments: MyConfig(name='value')
TypeError: Expected <class 'int'>, but got <class 'str'> for field 'count'
Value type does not match the field's type annotation.
fix
Ensure the value matches the declared type (e.g., cast to int).
Upgrade
Version history
0.2.5latest on PyPI · released Apr 10, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
coqpit-config — pip install coqpit-config · libregistry