pys
pyserde
pypi i pyserde
pys

pyserde

Yet another serialization library on top of dataclasses, inspired by serde-rs.

by yukinarit

0.8.3 (see all)License:MIT
pypi i pyserde
Readme

pyserde

Yet another serialization library on top of dataclasses, inspired by serde-rs.

image image Tests codecov

Guide | API Docs | Examples

Overview

Declare a class with pyserde's @serde decorator.

@serde
@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.

GitHub Stars

136

LAST COMMIT

5mos ago

MAINTAINERS

1

CONTRIBUTORS

14

OPEN ISSUES

21

OPEN PRs

1
VersionTagPublished
0.8.3
2mos ago
0.8.2
2mos ago
0.8.1
2mos ago
0.8.0
2mos ago
No alternatives found
No tutorials found
Add a tutorial