Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Latest commit

 

History

History
75 lines (62 loc) · 3.17 KB

README.md

File metadata and controls

75 lines (62 loc) · 3.17 KB

pyserde

Yet another serialization library on top of dataclasses.

image image Tests codecov

Guide | API Docs | Examples

Overview

Declare a class with pyserde's @serialize and @deserialize decorators.

@deserialize
@serialize
@dataclass
class Foo:
    i: int
    s: str
    f: float
    b: bool

You can serialize Foo object into JSON.

>>> to_json(Foo(i=10, s='foo', f=100.0, b=True))
{"i": 10, "s": "foo", "f": 100.0, "b": true}

You can deserialize JSON into Foo object.

>>> from_json(Foo, '{"i": 10, "s": "foo", "f": 100.0, "b": true}')
Foo(i=10, s='foo', f=100.0, b=True)

Features

LICENSE

This project is licensed under the MIT license.