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;
# }
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e8737d9642d5609181969865e391db32e2e9e8f370dd746666e01046ab00249
|
|
| MD5 |
d636bab0f8dad0fb51f6f60294c62f28
|
|
| BLAKE2b-256 |
c1186b88b55d456c0e910900eabb6bcd841aa668fc63a661d70ddb94847657f5
|
File details
Details for the file quicktype_ts-0.1.1-py3-none-any.whl.
File metadata
- Download URL: quicktype_ts-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/5.0.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae32a790d9820bcf0b342ede6759eb223e0052dfc8bed600c2ab1b905af6cdff
|
|
| MD5 |
a973f39daaf041fee46ca8a3f13bb385
|
|
| BLAKE2b-256 |
223093be06e6b274f4986a87894d7f21942b533588b2ec25376324b2eb18f925
|