pydantic-to-typescript2
Convert pydantic v1 and pydantic v2 models to typescript interfaces
Decision gist · record as of 2026-08-14
Yes, if you maintain both Python and TypeScript codebases that share data models. The low install friction and permissive license make it practical for eliminating type definition drift. However, maintenance is dormant—verify compatibility with your specific Pydantic and TypeScript versions before adopting, and plan for potential maintenance gaps if ecosystem changes occur.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires the json2ts CLI utility (json-schema-to-typescript npm package) to be installed and accessible on the system PATH.
- Low install friction with a single runtime dependency on pydantic.
- Maintenance is dormant (701 days since last release), though the package is marked Production/Stable and supports Python 3.8 through 3.12.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing use in commercial and private projects with minimal restrictions.
last release 2024-09-12 (701 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 90,689 downloads/mo, #13,567 on PyPI
Alternatives
Verify before relying
pip install pydantic-to-typescript2
# CLI usage:
pydantic2ts --module backend.api --output ./frontend/apiTypes.ts
# Or programmatic usage via the package's generate function- Whether dormant maintenance status affects compatibility with recent Pydantic releases or TypeScript ecosystem changes.
- Actual test coverage and reliability for complex nested Pydantic models or advanced field configurations.
- Performance characteristics when converting large codebases with many models.
What it is and what it does
pydantic-to-typescript2 is a command-line tool that reads Pydantic model definitions from Python modules and generates corresponding TypeScript interface definitions. It bridges the gap between Python and JavaScript/TypeScript codebases by allowing you to define your data schemas once in Pydantic and automatically export them as TypeScript types, eliminating the need to manually maintain duplicate type definitions across languages.
The tool scans Python modules for Pydantic models, converts them to JSON Schema, and then uses the json2ts utility to generate TypeScript interfaces. It can be invoked via CLI with module and output file paths, or programmatically. It supports excluding specific models and customizing the json2ts command invocation.
Use it for
- Synchronize API request/response types between a Python backend and a TypeScript frontend without manual duplication.
- Generate TypeScript types for a Python service's data models to ensure frontend code matches backend contracts.
- Automate type definition generation in a monorepo where Python and JavaScript services share domain models.
- Export Pydantic validation schemas as TypeScript interfaces for client-side type checking and IDE autocomplete.
- Maintain a single source of truth for data structures across polyglot microservices.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you maintain both Python and TypeScript codebases that share data models.
The low install friction and permissive license make it practical for eliminating type definition drift. However, maintenance is dormant—verify compatibility with your specific Pydantic and TypeScript versions before adopting, and plan for potential maintenance gaps if ecosystem changes occur.
Install
pydantic-to-typescript2 on PyPI
Before you install
Low install friction with a single runtime dependency on pydantic. Maintenance is dormant (701 days since last release), though the package is marked Production/Stable and supports Python 3.8 through 3.12.
Requires the json2ts CLI utility (json-schema-to-typescript npm package) to be installed and accessible on the system PATH.
License in practice
MIT license is permissive, allowing use in commercial and private projects with minimal restrictions.
Quickstart
pip install pydantic-to-typescript2
# CLI usage:
pydantic2ts --module backend.api --output ./frontend/apiTypes.ts
# Or programmatic usage via the package's generate function
Verify before relying
- Whether dormant maintenance status affects compatibility with recent Pydantic releases or TypeScript ecosystem changes.
- Actual test coverage and reliability for complex nested Pydantic models or advanced field configurations.
- Performance characteristics when converting large codebases with many models.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagepydantic |
| Maintenance | Dormant 701 days since the last release |
| First released | |
| Downloads | 90,689 / month, #13,567 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: pydantic_to_typescript2-1.0.6-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 › “pydantic to typescript conversion”
- pydantic-to-typescript2Converts Pydantic models to TypeScript interfaces via a CLI tool,…
- pydantic-to-typescriptConverts pydantic model definitions into TypeScript interface…
- jsiijsii is a Python runtime client that enables Python code to interact…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also pydantic-to-typescript · sparkdantic · fastui · pydantic-compat · pydantic-numpy · pydantic-factories · pydantic-to-pyarrow · pydantic_yaml · flask-pydantic-spec · jsii