typtyp
Convert Python types and type annotations to TypeScript type definitions.
Features
- Convert dataclasses, TypedDict, enums, and Pydantic models to TypeScript
- Support for Python's standard typing primitives
- Rich type support (dates, UUIDs, complex collections, etc.)
- Simple API for declaring types for conversion
Installation
pip install typtyp
Usage
from dataclasses import dataclass
from typing import List, Optional
import typtyp
@dataclass
class User:
name: str
email: str
age: Optional[int] = None
@dataclass
class Team:
name: str
members: List[User]
# Create a world to collect types
world = typtyp.World()
# Add types to the world
world.add(User)
world.add(Team)
# Generate TypeScript
typescript_code = world.get_typescript()
print(typescript_code)
Output (approximately – you would want to run typtyp's output through a formatter of your liking):
export interface User {
name: string;
email: string;
age: number | null;
}
export interface Team {
name: string;
members: User[];
}
Release files for typtyp 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| typtyp-0.2.0.tar.gz | 25.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| typtyp-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.9 kB
Release files / typtyp-0.2.0.tar.gz
| Download URL | typtyp-0.2.0.tar.gz |
|---|---|
| Size | 25.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a198c0c4079add5736e0e90e0bbc18feb1bd49542eb1c5d33bb5aab2c885ccf
|
|
BLAKE2b-256 checksum How to use checksums |
0db0bdb85f351e0fbc3ce9d7c13a25f7d16770e929b48707e2aae346523c8bdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency logRelease files / typtyp-0.2.0-py3-none-any.whl
| Download URL | typtyp-0.2.0-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b742453a52d4240151d52e679a7d0527a9afa1169c053a87d13996388747054a
|
|
BLAKE2b-256 checksum How to use checksums |
59ad0579721e4f2c4d1c25c242e43fea86a582024da66c565de29f3beedd0a58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency log