typewriter-python 0.1.1

Python Pydantic emitter for the typewriter type sync SDK
Documentation

typewriter-python

Python Pydantic emitter for the typewriter SDK.

Crates.io Docs.rs

What It Generates

Rust Python
struct Pydantic BaseModel class
Simple enum class Role(str, Enum)
Tagged enum Union[...] with Literal discriminators
Option<T> Optional[T] = None
Vec<T> list[T]
HashMap<K,V> dict[K, V]

Example Output

from pydantic import BaseModel
from typing import Optional

class UserProfile(BaseModel):
    id: str
    email: str
    age: Optional[int] = None
    tags: list[str]

Usage

Used internally by typewriter-macros. Most users should depend on the main typewriter crate.

License

Apache-2.0 — Darshan Vichhi