Skip to main content

Yet another serialization library on top of dataclasses

Project description

pyserde

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

pypi pypi GithubActions 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

Contributors ✨

Thanks goes to these wonderful people (emoji key):

yukinarit
yukinarit

💻
Alexander Miskaryan
Alexander Miskaryan

💻
ydylla
ydylla

💻
Kevin Squire
Kevin Squire

💻 📖
Yushi OMOTE
Yushi OMOTE

💻
Yuji Kanagawa
Yuji Kanagawa

💻
Weiliang Li
Weiliang Li

💻
Mauve
Mauve

💻
adsharma
adsharma

💻
Guilhem C.
Guilhem C.

📖
Pierre Tardy
Pierre Tardy

💻
Raphael Nestler
Raphael Nestler

📖
Pranav V P
Pranav V P

💻
andreymal
andreymal

💻
Johann Fuechsl
Johann Fuechsl

💻
DoeringChristian
DoeringChristian

💻
Stuart Axelbrooke
Stuart Axelbrooke

💻
Jakub Beránek
Jakub Beránek

💻
Fredrik Reinholdsen
Fredrik Reinholdsen

💻
Bruno Oliveira
Bruno Oliveira

📖
Kyle Kosic
Kyle Kosic

💻
Gajo Petrovic
Gajo Petrovic

📖
Add your contributions

This project follows the all-contributors specification. Contributions of any kind welcome!

LICENSE

This project is licensed under the MIT license.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyserde-0.11.1.tar.gz (37.0 kB view hashes)

Uploaded Source

Built Distribution

pyserde-0.11.1-py3-none-any.whl (38.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page