@sergi
Pydantic's model class has methods to populate an instance from attributes on an arbitrary object, and to go from a model instance to a dict for serialization. That would require defining the model's fields, though.
I don't remember for sure, but it might also have a way to create a model definition from reflection, which would get you the rest of the way...
=> More informations about this toot | View the thread | More toots from cazabon@mindly.social
=> View sergi@floss.social profile
text/gemini
This content has been proxied by September (3851b).