coqpit-config
Simple (maybe too simple), light-weight config management through python data-classes.
What it is and what it does
Coqpit-config is a configuration management library built on Python dataclasses that handles schema definition, validation, and serialization without external dependencies. It lets you define configuration schemas as dataclasses with type hints and default values, then serialize them to JSON, load them back, and override values from the command line. The library supports nested configurations, inheritance, and dynamic value checking through a check_values() method you can define on your config class.
It's designed for machine learning workflows where you need to manage experiment configurations, hyperparameters, and dataset paths that change between runs. You can decompose large configs into nested dataclasses, validate field ranges and types, and easily swap parameters via command-line arguments without modifying code. The library intentionally avoids external dependencies beyond typing-extensions to keep your environment minimal.
Use it for:
- Define and validate ML experiment hyperparameters with type checking and default ranges.
- Save and load training configurations to JSON files for reproducibility across runs.
- Override configuration values from the command line for hyperparameter search without code changes.
- Organize large configuration files into nested dataclasses for readability and maintainability.
- Enforce consistent configuration schemas across different platforms or programming languages via JSON export.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Coqpit-config provides lightweight configuration management through Python dataclasses with JSON serialization, type checking, and command-line argument parsing.
Yes. Coqpit-config is a lightweight, actively maintained solution for configuration management with no external dependencies beyond typing-extensions. It's well-suited for ML projects and any Python application needing structured, validated configs with JSON persistence and CLI override support. The MIT license and recent maintenance signal make it a low-risk choice.
Install
coqpit-config on PyPI
pip
pip install coqpit-configuv
uv add coqpit-configpoetry
poetry add coqpit-configInstalling coqpit-config
Before you install
Low install friction with a single runtime dependency (typing-extensions). Active maintenance with recent commits and no known vulnerabilities.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions, suitable for both open-source and commercial projects.
Quickstart
pip install coqpit-config
from dataclasses import dataclass
from coqpit import Coqpit
@dataclass
class MyConfig(Coqpit):
val_a: int = 10
val_b: str = "example"
config = MyConfig()
config.save_json('config.json')
config2 = MyConfig()
config2.load_json('config.json')
Requires Python 3.10 or later.
Verify before relying
- Whether Union-typed fields in console arguments are truly unsupported or have workarounds.
- Performance characteristics with deeply nested or very large configuration hierarchies.
- Compatibility with dataclass features beyond basic field types and defaults.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — typing-extensions |
| Maintenance | actively maintained — 126 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 125,196/month — #11,832 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: coqpit_config-0.2.5-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI 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
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
coqpitCoqpit provides configuration management…
unclear · top 15,000 on PyPI
simple-parsingTransforms argparse scripts into structured,…
permissive · top 5,000 on PyPI
dataclass-wizardDataclass Wizard converts Python dataclasses to…
permissive · top 5,000 on PyPI
databindDatabind deserializes JSON-like nested data…
permissive · top 15,000 on PyPI
databind.jsonDeserializes and serializes Python dataclasses…
permissive · top 15,000 on PyPI
databind.coreDeserializes and serializes Python dataclasses…
permissive · top 15,000 on PyPI
argparse-dataclassBuilds command-line interfaces declaratively by…
permissive · top 5,000 on PyPI
draccusDraccus parses command-line arguments and…
permissive · top 5,000 on PyPI
daciteConverts dictionaries into dataclass instances…
permissive · top 1,000 on PyPI
coqui-ttsCoqui TTS synthesizes speech from text using…
copyleft · top 15,000 on PyPI