--- id: warchant-dc-schema version: "0.0.10" license: MIT license_treatment: permissive maintenance: dormant --- # warchant_dc_schema — Generate JSON schema from python dataclasses License: permissive · Maintenance: dormant · Downloads: 102.6K/mo ## What it is and what it does warchant_dc_schema is a lightweight, zero-dependency library that converts Python dataclasses into valid JSON Schema (2020-12 draft) documents. It reads dataclass field types, defaults, and optional metadata annotations to produce schema output suitable for validation, documentation, or API specifications. The package is designed as a minimal alternative when you only need schema generation from plain dataclasses. It supports nested dataclasses, optional fields, datetime types, and custom metadata via typing.Annotated. You can also customize dataclass-level schema properties using a SchemaConfig inner class. Recent versions add patternProperties and additionalProperties support. The library includes a CLI tool and a test suite demonstrating supported features. Use it for: - Generate OpenAPI or JSON Schema documentation from dataclass-based API request/response models. - Validate incoming JSON data against a schema derived from your dataclass definitions. - Export dataclass structures as reusable schema files for cross-language API contracts. - Add schema metadata (descriptions, examples, validation rules) to dataclasses without a full validation framework. - Build lightweight schema-driven tools or code generators that operate on dataclass definitions. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates JSON Schema (2020-12 draft) from Python dataclasses with no external dependencies, using only the standard library. Yes, if you need lightweight JSON schema generation from dataclasses and want to avoid large dependencies. The zero-dependency design and standard-library-only approach make it easy to integrate. However, dormant maintenance (last commit 2024-02-13) means you should expect no active bug fixes or feature updates; use it for stable, self-contained schema generation tasks, not as a foundation for rapidly evolving systems. ## Install pip install warchant-dc-schema uv add warchant-dc-schema poetry add warchant-dc-schema ## Installing warchant_dc_schema Before you install: Low friction install with no runtime dependencies. Dormant maintenance status (last commit 2024-02-13, 913 days since release) means no active development, though the repository is not archived. License in practice: MIT license permits commercial and private use with minimal restrictions—you may use, modify, and distribute the package freely provided you include the license notice. Quickstart: pip install warchant-dc-schema import dataclasses from warchant_dc_schema import get_schema @dataclasses.dataclass class Book: title: str published: bool = False schema = get_schema(Book) Requires Python 3.9 or later (requires_python: >=3.9,<4.0). Verify before relying: - Whether patternProperties and additionalProperties features (added in 0.0.9–0.0.10) are production-ready or experimental. - Real-world validation performance compared to alternatives for large or deeply nested dataclass hierarchies. - Whether the CLI tool is actively maintained or documented beyond the brief mention in the description. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 102.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags json schema from dataclasses, dataclass to json schema, generate json schema python, schema validation dataclasses, json schema generator, dataclass schema export, python dataclass validation, schema-generation, dataclass-tooling, json-schema [View on SkillFed](https://skillfed.io/packages/warchant-dc-schema) · [View on PyPI](https://pypi.org/project/warchant-dc-schema/)