facet-python 0.44.4

Generate Python type definitions from facet type metadata
Documentation

facet-python

Generate Python type definitions from facet type metadata.

This crate uses facet’s reflection capabilities to generate Python type hints and TypedDicts from any type that implements Facet.

Example

use facet::Facet;
use facet_python::to_python;

#[derive(Facet)]
struct User {
    name: String,
    age: u32,
    email: Option<String>,
}

let py = to_python::<User>(false);
assert!(py.contains("class User(TypedDict"));