coqpit
Simple (maybe too simple), light-weight config management through python data-classes.
What it is and what it does
Coqpit is a lightweight configuration library built on Python dataclasses that lets you define structured configs with type hints, default values, and validation. It handles serialization to and from JSON, supports nested and inherited configurations, and can parse values from command-line arguments—useful for machine learning workflows where you need to swap parameters without changing code.
The package intentionally avoids external dependencies, relying only on the standard library's dataclasses module. It's designed for scenarios where you want a schema-driven config file that can be read by other programming languages via JSON, with built-in type checking and the ability to mark fields as mandatory or provide dynamic defaults. The library also supports pretty-printing configs and exporting them to dictionaries for programmatic access.
Use it for:
- Define and validate ML training configs with typed fields, default values, and range constraints for hyperparameter experiments.
- Save and load experiment configurations to JSON, then share or version-control them independently of code.
- Override config values from the command line during training runs without modifying the source code or config files.
- Organize large configs into nested dataclasses for dataset, preprocessing, and model parameters, keeping them maintainable.
- Enforce that certain config fields are explicitly set before use, catching missing required values early.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Coqpit provides configuration management through Python dataclasses with JSON serialization, type checking, and command-line argument parsing, designed for machine learning projects that need portable, schema-driven configs.
Yes, if you need a minimal, dependency-free config system for ML projects and can tolerate dormant maintenance. The package is stable for its current scope—JSON serialization, nested configs, and CLI parsing work as documented. However, do not use it if you require active maintenance, ongoing Python version support, or a clear license statement. Verify the license in the repository before production use.
Install
coqpit on PyPI
pip
pip install coqpituv
uv add coqpitpoetry
poetry add coqpitInstalling coqpit
Before you install
Low install friction with only a standard library dependency (dataclasses). However, the package is dormant—last release was 2022-12-21 and no commits for 1332 days—so expect no active maintenance or bug fixes.
License in practice
License status is unclear; the package metadata contains no license declaration. Before using in production or distributing, verify the actual license terms in the repository.
Quickstart
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')
config.load_json('config.json')
Requires Python >=3.7.0.
Verify before relying
- Whether the unclear license status has been resolved or clarified in the repository since the last release.
- Whether the dormant status means the package is stable and complete, or abandoned and at risk of incompatibility with future Python versions.
- Real-world adoption beyond the cited TTS project and whether active forks or maintained alternatives exist.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.7.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — dataclasses |
| Maintenance | dormant — 1,332 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 101,226/month — #12,952 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: coqpit-0.0.17-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
coqpit-configCoqpit-config provides lightweight…
permissive · top 15,000 on PyPI
dataclass-wizardDataclass Wizard converts Python dataclasses to…
permissive · top 5,000 on PyPI
databind.jsonDeserializes and serializes Python dataclasses…
permissive · top 15,000 on PyPI
simple-parsingTransforms argparse scripts into structured,…
permissive · top 5,000 on PyPI
databindDatabind deserializes JSON-like nested data…
permissive · top 15,000 on PyPI
polyfactoryPolyfactory generates mock data objects from…
permissive · top 5,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
daciteConverts dictionaries into dataclass instances…
permissive · top 1,000 on PyPI
warchant_dc_schemaGenerates JSON Schema (2020-12 draft) from…
permissive · top 15,000 on PyPI