Registry / devops / jsonschema-gentypes

jsonschema-gentypes

JSON →
library2.13.0pypypi✓ verified 80d ago

Tool to generate Python types (TypedDict, dataclasses) from JSON Schema definitions. Version 2.13.0, requires Python >=3.10. Active development.

pip install jsonschema-gentypes
INSTALL
IMPORT
SIG · JSONSCHEMA-GENTYPE
J
jsonschema-gentypes
devopspythonv2.13.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

Type
from jsonschema_gentypes import Type
from jsonschema_gentypes import SchemaParser
TypedDictType
from jsonschema_gentypes import TypedDictType
cast
from jsonschema_gentypes import cast

Parse a JSON Schema and generate TypedDict Python code.

from jsonschema_gentypes import SchemaParser, generate_types schema = { "type": "object", "properties": { "name": {"type": "string"}, "age": {"type": "integer"} }, "required": ["name", "age"] } parser = SchemaParser() # Parse the schema result = parser.parse(schema) # Generate TypedDict Python code code = generate_types(result) print(code)
Debug
Known issues
breakingIn v2.0.0, the API changed from argparse CLI to programmatic use; CLI was removed. Scripts relying on command-line invocation will break.
fix
Use the Python API (SchemaParser, generate_types) instead of CLI.
affects: >=2.0.0
breakingSchemaParser no longer accepts a file path directly; you must pass a dict or JSON string.
fix
Load your JSON file into a Python dict first, then pass to SchemaParser.parse().
affects: >=2.0.0
deprecatedThe option to generate dataclasses (instead of TypedDict) is deprecated and will be removed in v3.0.
fix
Switch to TypedDict generation if needed, or pin to <3.0.
affects: >=2.10.0
gotchaThe library does not validate the input JSON Schema; malformed schemas may produce cryptic errors.
fix
Ensure your schema is valid JSON Schema before passing to SchemaParser.
affects: all
gotchaGenerated TypedDict names are derived from schema title; if title is missing, names become generic ('GeneratedType').
fix
Always include a 'title' in your JSON Schema definitions.
affects: all
Upgrade
Version history
2.13.0latest on PyPI · released Nov 26, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
14
Resources
jsonschema-gentypes — pip install jsonschema-gentypes · libregistry