skillfed

chz

chz is a library for managing configuration

chz v0.4.0 1.1M downloads/30d#4,341 on PyPI237
Permissive 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) AGING released

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 chz

uv

uv add chz

poetry

poetry add chz

Installing 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

configuration management librarycommand line argument parsingconfig validation and type checkingdeclarative configuration objectscli config management
cli-toolsconfig-managementtype-safe

More Software Development packages