skillfed

coqpit-config

Simple (maybe too simple), light-weight config management through python data-classes.

coqpit-config v0.2.5 125.2K downloads/30d#11,832 on PyPI3
Permissive license MIT Active released

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-config

uv

uv add coqpit-config

poetry

poetry add coqpit-config

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

python dataclass config managementjson serialization configurationcommand line argument parsing configtype checking configuration librarynested config inheritanceml experiment hyperparameter configlightweight config no dependencies
dataclass-configml-experiment-trackingjson-serialization

More Software Development packages