jsonschema-gentypes
Tool to generate Python types based on TypedDict from a JSON Schema
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive license, and solves a real problem for teams using schema-first API design. Install friction is low and it integrates well into existing workflows via CLI, config files, and pre-commit hooks. Suitable for production use.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later (supports 3.10, 3.11, 3.12, 3.13).
- Low friction: pure Python wheel with six common runtime dependencies (PyYAML, jsonschema, referencing, requests, typing-extensions, urllib3).
- Actively maintained with recent release and no known vulnerabilities.
License · maintenance · safety
BSD-2-Clause (permissive) — BSD-2-Clause is permissive; you can use this in commercial and proprietary projects with minimal restrictions beyond retaining the license notice.
last release 2025-11-26 (261 days) · last repo commit 2026-08-14 · 48 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 75,436 downloads/mo, #14,714 on PyPI
Alternatives
Verify before relying
pip install jsonschema-gentypes
jsonschema-gentypes --json-schema=schema.json --python=types.py
# Or via config file (jsonschema-gentypes.yaml):
jsonschema-gentypes- Whether generated types are fully compatible with runtime type checkers like mypy and pyright in all schema patterns.
- Performance characteristics when processing very large or deeply nested JSON schemas.
- Completeness of OpenAPI3 support relative to the full OpenAPI3 specification.
What it is and what it does
jsonschema-gentypes is a command-line tool that reads JSON Schema files and generates Python source code containing TypedDict type definitions. It bridges the gap between schema-first API design and Python's static type system, letting you define your data contracts once in JSON Schema and automatically produce typed Python code that can be validated against those schemas.
The tool supports both standard JSON Schema and OpenAPI3 schemas, automatically detecting which format you're using. It integrates with code formatters like black and isort, can be run as a pre-commit hook, and exports default values from the schema so you can use them in your Python code. It requires Python 3.10 or later and depends on jsonschema, PyYAML, requests, referencing, typing-extensions, and urllib3.
Use it for
- Generate type-safe request/response models from an OpenAPI3 specification for use in web frameworks like Pyramid or FastAPI.
- Maintain a single JSON Schema as the source of truth for data validation while keeping Python types automatically in sync.
- Integrate schema-driven code generation into CI/CD pipelines via pre-commit hooks to catch type mismatches early.
- Build strongly-typed data validation layers in microservices without manually writing TypedDict classes.
- Generate Python types from shared JSON Schema definitions across multiple services or repositories.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, uses a permissive license, and solves a real problem for teams using schema-first API design. Install friction is low and it integrates well into existing workflows via CLI, config files, and pre-commit hooks. Suitable for production use.
Install
jsonschema-gentypes on PyPI
Before you install
Low friction: pure Python wheel with six common runtime dependencies (PyYAML, jsonschema, referencing, requests, typing-extensions, urllib3). Actively maintained with recent release and no known vulnerabilities.
Requires Python 3.10 or later (supports 3.10, 3.11, 3.12, 3.13).
License in practice
BSD-2-Clause is permissive; you can use this in commercial and proprietary projects with minimal restrictions beyond retaining the license notice.
Quickstart
pip install jsonschema-gentypes
jsonschema-gentypes --json-schema=schema.json --python=types.py
# Or via config file (jsonschema-gentypes.yaml):
jsonschema-gentypes
Verify before relying
- Whether generated types are fully compatible with runtime type checkers like mypy and pyright in all schema patterns.
- Performance characteristics when processing very large or deeply nested JSON schemas.
- Completeness of OpenAPI3 support relative to the full OpenAPI3 specification.
Package facts
| License | BSD-2-Clause permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagesPyYAMLjsonschemareferencingrequeststyping-extensionsurllib3 |
| Maintenance | Actively maintained 261 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 75,436 / month, #14,714 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Software Development :: Code GeneratorsTyping :: Typed |
Evidence: jsonschema_gentypes-2.13.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “json schema to python types”
- jsonschema-gentypesGenerates Python TypedDict types from JSON Schema definitions, with…
- jsonschema-typed-v2Generates Python TypedDict type annotations automatically from JSON…
- warchant_dc_schemaGenerates JSON Schema (2020-12 draft) from Python dataclasses with no…
Give your agent the search over MCP, or paste the wish link into any chat.
More Code Generators packages
Proto Plus wraps protocol buffers to provide Python classes that behave like native Python types while maintaining protocol buffer serialization and schema validation.
Install it if you're working with protocol buffers in Python and want a more Pythonic interface, or if you're using Google Cloud libraries that depend on it.
Cython is a source code translator that compiles Python code to C, enabling optional static typing and direct C/C++ interoperability to generate efficient native extensions.
Install it if you need to optimize Python performance, wrap C/C++ libraries, or build fast native extensions.
Annotates Python abstract syntax trees with the positions of tokens and source code text, enabling tools to map AST nodes back to their originating code for refactoring, analysis, and transformation.
Beartype is a runtime type checker that validates Python type hints at function call time, catching type violations before they cause downstream bugs.
Install it if you want runtime type safety for your annotated code or need to validate type hints on third-party packages.
llvmlite provides a lightweight Python binding to LLVM's IR builder, optimizer, and JIT compiler APIs, enabling you to write JIT compilers and code generators without needing the full LLVM C++ API surface.
astor converts Python abstract syntax trees (ASTs) back to readable source code and provides tools for AST manipulation, inspection, and non-recursive tree traversal.
Install it if you need AST round-tripping or advanced tree inspection.
See also check-jsonschema · datamodel-code-generator · marshmallow-jsonschema · jsonschema-pydantic · jschema-to-python · jsonschema-typed-v2 · dydantic · openapi-schema-pydantic · json-ref-dict · shrub.py