Skip to content

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

License

Notifications You must be signed in to change notification settings

gitpushdashf/pyserde

This branch is 547 commits behind yukinarit/pyserde:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1f8a17d · Jun 16, 2022
May 16, 2022
Apr 29, 2022
May 24, 2022
Jun 14, 2022
Jun 16, 2022
Jun 14, 2022
Jun 17, 2019
Sep 2, 2019
May 16, 2022
Apr 26, 2022
Jun 14, 2022
Aug 4, 2021
Aug 4, 2021
Apr 28, 2022
May 24, 2022
Sep 29, 2021
May 12, 2021
Jun 16, 2022
May 26, 2022

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%