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.

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

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.7.2.tar.gz (25.8 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.7.2-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyserde-0.7.2.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.10 Darwin/20.6.0

File hashes

Hashes for pyserde-0.7.2.tar.gz
Algorithm Hash digest
SHA256 12bff11f9197e219db043f797bb5254b081ce0b4d471f11bf4271d65c01adb62
MD5 15b77526fc71a6d956155a6d4372b97d
BLAKE2b-256 e3aeb60c88eee9a75d2bfe1b7595b0494cf26a3ad2a5d4364018724bfc593389

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyserde-0.7.2-py3-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.10 Darwin/20.6.0

File hashes

Hashes for pyserde-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5878dd91151e3c350522fa50a8e03408fadfdc01bd2575e80622331e3e90773e
MD5 b7a9a1176e95aa554c1ad263e1d77f2c
BLAKE2b-256 86b3256fc896de7f9413770f97ad9dfc0af12a0de6a80eee44dad8f583ee7aa0

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