$npx skillfedfor your agent

pydantic-to-typescript

Convert pydantic models to typescript interfaces

With conditionsPyPI Software DevelopmentReleased Nov 2024863.7K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pydantic_to_typescript-2.0.0-py3-none-any.whl
v2.0.0 · released 2024-11-22 · Python >=3.8 · 1 runtime deps: pydantic

Yes, if you have a Python backend with pydantic models and a TypeScript frontend that needs to stay in sync. The package solves a real problem—type definition drift—with minimal overhead. Install friction is low and the MIT license is unrestricted. The main caveat is dormant maintenance (last release 630 days ago), so if you rely on cutting-edge pydantic features or need active support, evaluate whether the tool handles your specific model patterns before committing.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires json2ts CLI utility (npm package json-schema-to-typescript) to be installed and accessible on the system PATH or specified via --json2ts-cmd flag.
  • Low friction install with a single runtime dependency (pydantic).
  • Maintenance is dormant—last commit was 2024-11-22 and no release in 630 days—but the package is marked Production/Stable and carries 432 GitHub stars, suggesting it remains functional for its narrow use case.

License · maintenance · safety

MIT (permissive) — MIT license (permissive) places no restrictions on use, modification, or distribution in commercial or proprietary projects.

last release 2024-11-22 (630 days) · last repo commit 2024-11-22 · 432 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 863,682 downloads/mo, #4,867 on PyPI

Verify before relying

pip install pydantic-to-typescript

from pydantic import BaseModel

class User(BaseModel):
    name: str
    age: int

# Then run: pydantic2ts --module mymodule --output ./types.ts
  • Whether the package handles complex pydantic features (validators, computed fields, discriminated unions) correctly in TypeScript output.
  • Performance characteristics when converting large numbers of models or deeply nested model hierarchies.
  • Compatibility with recent pydantic v2 field definitions and serialization modes beyond basic type mapping.
Same gist for agents: .md · .json

What it is and what it does

pydantic-to-typescript is a CLI tool that reads pydantic model definitions from a Python module and generates corresponding TypeScript interface definitions. It bridges the gap between Python and JavaScript type systems by allowing teams to maintain a single authoritative source of type definitions in Python, then automatically generate matching TypeScript interfaces for frontend consumption. The tool depends on pydantic for model introspection and json2ts for the actual TypeScript generation.

The package is designed for full-stack applications where Python backends serve APIs consumed by TypeScript/JavaScript frontends. Instead of manually keeping type definitions in sync across languages, you define your data models once in pydantic and run the tool to generate TypeScript interfaces that match exactly. The generated interfaces are marked as auto-generated to discourage manual edits, reinforcing the single-source-of-truth pattern.

Use it for

  • Generate TypeScript types for a backend's request/response models to keep frontend and backend type definitions synchronized.
  • Exclude sensitive or internal pydantic models from TypeScript output using the --exclude flag when only a subset of models should be exposed.
  • Integrate into a build pipeline to regenerate TypeScript definitions whenever pydantic models change, ensuring frontend types never drift from backend reality.
  • Convert a Python module with multiple interdependent pydantic models into a single TypeScript definitions file for import across a frontend codebase.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you have a Python backend with pydantic models and a TypeScript frontend that needs to stay in sync.

The package solves a real problem—type definition drift—with minimal overhead. Install friction is low and the MIT license is unrestricted. The main caveat is dormant maintenance (last release 630 days ago), so if you rely on cutting-edge pydantic features or need active support, evaluate whether the tool handles your specific model patterns before committing.

Install

pydantic-to-typescript on PyPI

Before you install

Low friction install with a single runtime dependency (pydantic). Maintenance is dormant—last commit was 2024-11-22 and no release in 630 days—but the package is marked Production/Stable and carries 432 GitHub stars, suggesting it remains functional for its narrow use case.

Requires json2ts CLI utility (npm package json-schema-to-typescript) to be installed and accessible on the system PATH or specified via --json2ts-cmd flag.

License in practice

MIT license (permissive) places no restrictions on use, modification, or distribution in commercial or proprietary projects.

Quickstart

pip install pydantic-to-typescript

from pydantic import BaseModel

class User(BaseModel):
    name: str
    age: int

# Then run: pydantic2ts --module mymodule --output ./types.ts

Verify before relying

  • Whether the package handles complex pydantic features (validators, computed fields, discriminated unions) correctly in TypeScript output.
  • Performance characteristics when converting large numbers of models or deeply nested model hierarchies.
  • Compatibility with recent pydantic v2 field definitions and serialization modes beyond basic type mapping.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
pydantic
MaintenanceDormant 630 days since the last release
Last repo commit
First released
Downloads863,682 / month, #4,867 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone 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.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Evidence: pydantic_to_typescript-2.0.0-py3-none-any.whl

Tags

Capabilities
pydantic to typescript conversiongenerate typescript from python modelspython typescript type syncpydantic typescript interface generatorcross-language type definitionspython javascript type bridge
Topics
type-generationcross-language-syncapi-tooling
PyPI keywords
annotationsinterfacepydantictypescriptvalidation

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 › “generate typescript from python models”

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

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.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

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.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

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.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

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.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

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.

permissive licensepure Python
323.3Mdownloads / mo

See also pydantic-to-typescript2 · sparkdantic · fastui · jsonschema-pydantic-converter · pydantic-factories · pydantic-to-pyarrow · pydantic-numpy · flask-pydantic-spec · pylint-pydantic · pydantic-handlebars