Skip to main content

Generate typescript types from pydantic models (or JSON schemas) using Quicktype

Project description

Quicktype Ts

Generate typescript types from pydantic models (or JSON schemas) using Quicktype

Usage

Make sure you have quicktype installed:

npm -g i quicktype
from pydantic import BaseModel, ConfigDict
from quicktype_ts import pydantic2typescript

class User(BaseModel):
  model_config = ConfigDict(extra='forbid')
  name: str
  age: int
  friends: list['User']

print(pydantic2typescript(User))
# export type User = {
#     age:     number;
#     friends: User[];
#     name:    string;
# }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quicktype-ts-0.1.1.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

quicktype_ts-0.1.1-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file quicktype-ts-0.1.1.tar.gz.

File metadata

  • Download URL: quicktype-ts-0.1.1.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for quicktype-ts-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3e8737d9642d5609181969865e391db32e2e9e8f370dd746666e01046ab00249
MD5 d636bab0f8dad0fb51f6f60294c62f28
BLAKE2b-256 c1186b88b55d456c0e910900eabb6bcd841aa668fc63a661d70ddb94847657f5

See more details on using hashes here.

File details

Details for the file quicktype_ts-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for quicktype_ts-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae32a790d9820bcf0b342ede6759eb223e0052dfc8bed600c2ab1b905af6cdff
MD5 a973f39daaf041fee46ca8a3f13bb385
BLAKE2b-256 223093be06e6b274f4986a87894d7f21942b533588b2ec25376324b2eb18f925

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page