Toot

Written by C. on 2024-10-23 at 00:00

@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

Mentions

=> View sergi@floss.social profile

Tags

Proxy Information
Original URL
gemini://mastogem.picasoft.net/toot/113353794061692691
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
224.210098 milliseconds
Gemini-to-HTML Time
0.417219 milliseconds

This content has been proxied by September (3851b).