Yet another serialization library on top of dataclasses
pyserde Yet another serialization library on top of dataclasses. TL;DR Put additional @serialize and @deserialize decorator in your ordinary dataclass. @deserialize @serialize @dataclass class Foo: i: int s: str f: float b: bool Now you can convert an object to JSON, >>> to_json(Foo(i=10, s=’foo’, f=100.0, b=True)) {“i”: 10, “s”: “foo”, “f”: 100.0, “b”: true} Converted back from JSON to the object quite easily! >>> from_json(Foo, ‘{“i”: 10, “s”: “foo”, “f”: 100.0, “b”: true}’) Foo(i=10, s=’foo’, f=100.0, b=True) pyserde supports other […]
Read more