chz
chz is a library for managing configuration
What it is and what it does
chz is a configuration management library from OpenAI that lets you define configuration objects declaratively and parse them from the command line with full type checking and validation. It provides an object model with immutability, field-level control, and built-in help generation for CLI discoverability. The library handles serialization and deserialization, supports partial application and presets for shared configuration, and integrates post-initialization hooks for custom logic.
You use chz by defining a configuration class with typed fields, then calling methods to parse from CLI arguments or load from serialized form. It's designed to replace ad-hoc argparse or environment-variable handling with a declarative, type-safe alternative that catches configuration errors early.
Use it for:
- Define and parse command-line tool configuration with automatic type validation and help text generation.
- Build reusable configuration presets or templates that can be partially applied and shared across applications.
- Validate and deserialize configuration from multiple sources (CLI, files, environment) into a single typed object model.
- Create CLI tools with built-in discoverability where help and error messages are generated from the configuration schema.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
chz is a configuration management library that handles command-line parsing, validation, and serialization of configuration objects with type checking and immutability support.
Yes, if you're building CLI tools or applications that need structured, validated configuration. The low install friction, permissive license, and active maintenance make it a solid choice. The aging status and lack of classifiers suggest it's stable but not rapidly evolving—suitable for production use when your Python version is 3.11+.
Install
chz on PyPI
pip
pip install chzuv
uv add chzpoetry
poetry add chzInstalling chz
Before you install
Low install friction with a single lightweight dependency (typing-extensions). The package is aging but actively maintained, with a recent commit on 2025-11-24 and no archived status.
License in practice
MIT License permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install chz
from chz import Config
class MyConfig(Config):
name: str
debug: bool = False
config = MyConfig.from_cli()
Requires Python 3.11 or later.
Verify before relying
- Whether the library's immutability guarantees are enforced at runtime or are type-level only.
- Performance characteristics when handling large configuration objects or deeply nested structures.
- Compatibility with popular config file formats (YAML, TOML, JSON) beyond what the serialization docs suggest.
Package facts
| License | MIT License Copyright (c) 2024 OpenAI Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — typing-extensions |
| Maintenance | aging — 263 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,119,778/month — #4,341 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: chz-0.4.0-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
mixboxMixbox provides shared utility code for…
permissive · top 15,000 on PyPI
colcon-corecolcon-core is a command-line tool that…
permissive · top 15,000 on PyPI
envierEnvier extracts application configuration from…
permissive · top 1,000 on PyPI
lazr.configlazr.config lets you define configuration…
copyleft · top 15,000 on PyPI
app-modelProvides a declarative schema for organizing…
permissive · top 15,000 on PyPI
parsyParsy is a parser combinator library that lets…
permissive · top 5,000 on PyPI
environ-configLoads application configuration from…
permissive · top 15,000 on PyPI
zope.securityProvides a generic security framework for…
unclear · top 15,000 on PyPI
pytoolconfigPytoolconfig reads and manages configuration…
copyleft · top 5,000 on PyPI
typing-jsonProvides type-aware JSON serialization and…
permissive · top 15,000 on PyPI