Registry / serialization / warchant-dc-schema

warchant-dc-schema

JSON →
library0.0.10pypypi✓ verified 81d ago

Generate JSON Schema from Python dataclasses. Version 0.0.10, requires Python >=3.9. Lightweight library with no runtime dependencies beyond Python standard library.

pip install warchant-dc-schema
INSTALL
IMPORT
SIG · WARCHANT-DC-SCHEMA
W
warchant-dc-schema
serializationpythonv0.0.10
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SchemaAnnotation
from dc_schema import SchemaAnnotation
from dc_schema import schema
get_schema
from dc_schema import get_schema
from dc_schema import schema

Define a dataclass and call schema() to get its JSON Schema.

from dataclasses import dataclass from dc_schema import schema @dataclass class User: name: str age: int json_schema = schema(User) print(json_schema)
Debug
Known issues
gotchaThe library does not support complex nested generics (e.g., List[Optional[int]]) properly. It may produce incorrect schemas for such types.
fix
Manually annotate with typing.Annotated or use workarounds described in issue #2.
affects: all
gotchaForward references (strings) are not resolved; you must annotate with actual types, not strings.
fix
Use `from __future__ import annotations` if you need string annotations, but ensure all types are importable.
affects: <=0.0.10
Upgrade
Version history
0.0.10latest on PyPI · released Feb 13, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
24
OpenAI (training)
1
Resources
warchant-dc-schema — pip install warchant-dc-schema · libregistry