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.1.tar.gz (56.5 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.1-py3-none-any.whl (73.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyserde-0.7.1.tar.gz
  • Upload date:
  • Size: 56.5 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.1.tar.gz
Algorithm Hash digest
SHA256 fc305feeb0624e9b278b03fd9be14c6240411ccf137e3fdc4b7097fd1b32f111
MD5 1ccde0f35836f56e4d5627bc1ccdd7a1
BLAKE2b-256 5be0b9e67739d69e70130cb6f4579f658641c4101b1c188d9c18bef91a92599b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyserde-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 73.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c3cab510da708c3ffe5dced9b4bd1e7a414a5383022110570c03e5c9999faf7c
MD5 ce8e7afe92a843da55f43b1191012481
BLAKE2b-256 69e87850f629e016623c35437a0e820d71d618210757593a15c1eb1c0f3971c5

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