Expand description
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"));Structs§
- Python
Generator - Generator for Python type definitions.
Functions§
- to_
python - Generate Python definitions for a single type.