Skip to main content

pyserde

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

pypi pypi GithubActions CodeCov

Guide🇬🇧 | ガイド🇯🇵 | API Reference | Examples

Overview

pyserde is a simple yet powerful serialization library on top of dataclasses. It allows you to convert Python objects to and from JSON, YAML, and other formats easily and efficiently.

Declare your class with @serde decorator and annotate fields using PEP484 as below.

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

That's it! If you're interested in pyserde, please check our documentation! Happy coding with pyserde! 🚀

Features

Extensions

Contributors ✨

Thanks goes to these wonderful people:

Made with contrib.rocks.

LICENSE

This project is licensed under the MIT license.

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.31.8.tar.gz (526.0 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.31.8-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyserde-0.31.8.tar.gz
  • Upload date:
  • Size: 526.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pyserde-0.31.8.tar.gz
Algorithm Hash digest
SHA256 89ec62bef818601f28dc2623ffe8e76236273c368d8775fcfed2fdc91154bc67
MD5 b835da50c560d41d8089d454aa857ad0
BLAKE2b-256 60a7b932b5885b129f6c0cadd1e1989a380f0cbf1f85131530ad9f7ab8abde25

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyserde-0.31.8-py3-none-any.whl
  • Upload date:
  • Size: 52.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pyserde-0.31.8-py3-none-any.whl
Algorithm Hash digest
SHA256 9f079577ff26c93ddcd468b025edf59b409b6f6d7fe002f8217fd5e707b1a11a
MD5 f783cb0413c57d9434b03fa1044d96dc
BLAKE2b-256 1d0e33dbe534a18edf1f6241e5aa30d95265cd5077a6f7bcc4c4e6c41778a475

See more details on using hashes here.

Release history Release notifications | RSS feed

Supported by

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