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

Extensions

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

📖
m472
m472

💻
acolley-gel
acolley-gel

💻
Marc-André Allaire
Marc-André Allaire

💻
Ganden Schaffner
Ganden Schaffner

💻
Dave Tapley
Dave Tapley

💻
Beartama
Beartama

💻
Rachael Sexton
Rachael Sexton

💻
JWSong
JWSong

💻
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.16.1.tar.gz (40.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyserde-0.16.1-py3-none-any.whl (42.4 kB view details)

Uploaded Python 3

File details

Details for the file pyserde-0.16.1.tar.gz.

File metadata

  • Download URL: pyserde-0.16.1.tar.gz
  • Upload date:
  • Size: 40.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1018-azure

File hashes

Hashes for pyserde-0.16.1.tar.gz
Algorithm Hash digest
SHA256 a17e58da4711a5f4753f628ac0447e852641be27467821a9a4998deb5da2eb7c
MD5 6d57df812ceba4dd541d2a7de2ca7874
BLAKE2b-256 f9b7f67695a1f747fc815182dab234d5b78cccba0710dc5ac2e27398e25b560c

See more details on using hashes here.

File details

Details for the file pyserde-0.16.1-py3-none-any.whl.

File metadata

  • Download URL: pyserde-0.16.1-py3-none-any.whl
  • Upload date:
  • Size: 42.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1018-azure

File hashes

Hashes for pyserde-0.16.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a13941d98d270a20e0b721ac3e19e45356490f8471e879643898c2bf07fa263
MD5 f5f48b31e544d7bd77a4620dcd2b3e30
BLAKE2b-256 472a48da57bed8815b75181e96f4adaa124720740f55fa9050d2d6cfbfb3aef0

See more details on using hashes here.

Supported by

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