Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: `perde-yaml` is included in `perde`

perde: python-wrapped serde

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. License PyPi Supported python versions Actions Status

Python wrapper around the powerful Rust serialization framework.

  • Serialization & deserialization of python data structures.
  • Supports dataclasses and most generics.
  • Supports various format. By design, perde can support as many format as serde can.
  • Provide case conversion of field names, skipping serialization/deserialization, structure flattening.
  • Strict type checking.
  • Very fast.

Install

pip install perde-json
pip install perde-yaml
pip install perde-msgpack

Usage

import perde_json
import perde_yaml
import perde_msgpack

@dataclass
class A:
    key: int
    value: str

# Serialize objects into json, yaml, msgpack
perde_json.dumps(A(300, "json"))
perde_yaml.dumps(A(300, "yaml"))
perde_msgpack.dumps(A(300, "msgpack"))

# Deserialize as dataclasses
perde_json.loads_as(A, '{"key": 300, "value": "hoge"}')
perde_yaml.loads_as(A, '''key: 300
value: hoge
''')
perde_msgpack.loads_as(A, b'\x82\xA3\x6B\x65\x79\xCD\x01\x2C\xA5\x76\x61\x6C\x75\x65\xCD\x01\x90')

# Deserialize as objects
perde_json.loads_as(A, '{"key": 300, "value": "hoge"}')
perde_yaml.loads_as(A, '''key: 300
value: hoge
''')
perde_msgpack.loads_as(A, b'\x82\xA3\x6B\x65\x79\xCD\x01\x2C\xA5\x76\x61\x6C\x75\x65\xCD\x01\x90')

Supported formats

  • JSON
  • YAML
  • MessagePack
  • CBOR
  • Toml
  • Pickle
  • RON
  • BSON
  • Avro
  • JSON5
  • Postcard
  • URL
  • Environment variables
  • AWS Parameter Store
  • S-expressions
  • D-Bus
  • FlexBuffer
  • XML

Benchmark

json(de) -------------------
json      = [0.1892565581947565, 0.1789955347776413, 0.19771194644272327, 0.17869805544614792, 0.1817416027188301]
perde as  = [0.07256896048784256, 0.06387559697031975, 0.06289006397128105, 0.06492204032838345, 0.06444761715829372]
perde     = [0.03787072375416756, 0.03849206678569317, 0.03701256774365902, 0.03784210607409477, 0.03712223842740059]
ujson     = [0.03571947664022446, 0.0350071769207716, 0.035524480044841766, 0.03537473827600479, 0.03500896133482456]
orjson    = [0.024663090705871582, 0.026005828753113747, 0.025051748380064964, 0.0264505036175251, 0.024867044761776924]

yaml(de) -------------------
yaml      = [1.8657512124627829, 1.8705988600850105, 1.8599027246236801, 1.8804237693548203, 1.8527513016015291]
perde as  = [0.29090225137770176, 0.27482700906693935, 0.2708629425615072, 0.2854452319443226, 0.28280119970440865]
perde     = [0.22424191236495972, 0.2495588045567274, 0.22433684580028057, 0.22169128619134426, 0.22160297632217407]

msgpack(de) ----------------
msgpack   = [0.03487630747258663, 0.035033950582146645, 0.03426872752606869, 0.03444667346775532, 0.03443203307688236]
perde as  = [0.07079600915312767, 0.05985707975924015, 0.06260973773896694, 0.060033876448869705, 0.0608107578009367]
perde     = [0.03339817374944687, 0.033870622515678406, 0.033603109419345856, 0.034254319965839386, 0.034998660907149315]
json(ser) ------------------
json      = [0.2153916023671627, 0.20939842239022255, 0.2292985152453184, 0.20938796736299992, 0.20893244817852974]
ujson     = [0.04131609573960304, 0.04082906246185303, 0.04345548339188099, 0.040903979912400246, 0.04144351929426193]
perde     = [0.053302960470318794, 0.053485700860619545, 0.054095394909381866, 0.05770992115139961, 0.05336238816380501]
orjson    = [0.04534510709345341, 0.045184383168816566, 0.046133121475577354, 0.0456595029681921, 0.04615986533463001]

yaml(ser) ------------------
yaml      = [1.8657512124627829, 1.8705988600850105, 1.8599027246236801, 1.8804237693548203, 1.8527513016015291]
perde     = [0.01173756830394268, 0.011586908251047134, 0.011359155178070068, 0.011403439566493034, 0.013109922409057617]

msgpack(ser) ---------------
msgpack   = [0.03487630747258663, 0.035033950582146645, 0.03426872752606869, 0.03444667346775532, 0.03443203307688236]
perde     = [0.054882919415831566, 0.05104514956474304, 0.05093616619706154, 0.050708770751953125, 0.05338519997894764]

Benchmark note

  • Deserialization
    • perde: Deserialize to dict. (non-dataclass)
    • perde as: Deserialize to dataclass.
    • Others: Deserialize to dict. (non-dataclass)
  • Serialization
    • perde, orjson: Serialize dataclasses.
    • Others: Serialize dict.

Metadata

Release files for perde-yaml 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for perde-yaml 0.0.1
File Size Uploaded Provenance Actions
perde_yaml-0.0.1.tar.gz 3.9 kB Without provenance Details for perde_yaml-0.0.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for perde-yaml 0.0.1
File Interpreter ABI Platform Actions
perde_yaml-0.0.1-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details for perde_yaml-0.0.1-cp38-cp38-manylinux1_x86_64.whl
perde_yaml-0.0.1-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details for perde_yaml-0.0.1-cp37-cp37m-manylinux1_x86_64.whl

Total release size: 640.9 kB

Release files / perde_yaml-0.0.1.tar.gz

Download URL perde_yaml-0.0.1.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ce235eccc418f6e62c529687a8de7e519002f0634405ba18adff90899b7833a7
BLAKE2b-256 checksum
How to use checksums
176ed79f022f606f1a244134c2f367630772ee1ce0fc7b59b5b5fbec46cfd742
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.8.3

Release files / perde_yaml-0.0.1-cp38-cp38-manylinux1_x86_64.whl

Download URL perde_yaml-0.0.1-cp38-cp38-manylinux1_x86_64.whl
Size 318.5 kB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
e7f9afe595d921b4e644fbd93979f0a15fb5fd4cfeec797485a27135e01a7d3f
BLAKE2b-256 checksum
How to use checksums
4c4c2a756da602c926a15e24c5eafb23b9f9ce0bca6fb63ef68a257bad59896b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.8.3

Release files / perde_yaml-0.0.1-cp37-cp37m-manylinux1_x86_64.whl

Download URL perde_yaml-0.0.1-cp37-cp37m-manylinux1_x86_64.whl
Size 318.5 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
d49726802afe908adf2548bbe70a9f384a3c7baab49918a381076595addb1253
BLAKE2b-256 checksum
How to use checksums
09d84b4855ac4cc0e4cd32ea4574cb842b6854a2d14a4ddffcce6dfeb2058ee9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.8.3

Security for perde-yaml 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

3 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page