Skip to main content

No project description provided

Project description

serpyco-rs: a serializer for python dataclasses

PyPI version Python versions CI status

What is serpyco-rs ?

Serpyco is a serialization library for Python 3.9+ dataclasses that works just by defining your dataclasses:

import dataclasses
import serpyco_rs

@dataclasses.dataclass
class Example:
    name: str
    num: int
    tags: list[str]


serializer = serpyco_rs.Serializer(Example)

result = serializer.dump(Example(name="foo", num=2, tags=["hello", "world"]))
print(result)

>> {'name': 'foo', 'num': 2, 'tags': ['hello', 'world']}

serpyco-rs works by analysing the dataclass fields and can recognize many types : list, tuple, Optional... You can also embed other dataclasses in a definition.

The main use-case for serpyco-rs is to serialize objects for an API, but it can be helpful whenever you need to transform objects to/from builtin Python types.

Installation

Use pip to install:

$ pip install serpyco-rs

Features

  • Serialization and unserialization of dataclasses
  • Validation of input/output data
  • Very fast
  • Support recursive schemas

Supported field types

There is support for generic types from the standard typing module:

  • Decimal
  • UUID
  • Time
  • Date
  • DateTime
  • Enum
  • List
  • Dict
  • Mapping
  • Sequence
  • Tuple (fixed size)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

serpyco_rs-0.2.1.tar.gz (29.7 kB view details)

Uploaded Source

Built Distributions

serpyco_rs-0.2.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

serpyco_rs-0.2.1-cp311-none-win_amd64.whl (182.0 kB view details)

Uploaded CPython 3.11 Windows x86-64

serpyco_rs-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

serpyco_rs-0.2.1-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (595.3 kB view details)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

serpyco_rs-0.2.1-cp310-none-win_amd64.whl (182.0 kB view details)

Uploaded CPython 3.10 Windows x86-64

serpyco_rs-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

serpyco_rs-0.2.1-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (595.3 kB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

serpyco_rs-0.2.1-cp39-none-win_amd64.whl (182.3 kB view details)

Uploaded CPython 3.9 Windows x86-64

serpyco_rs-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

serpyco_rs-0.2.1-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (595.9 kB view details)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

File details

Details for the file serpyco_rs-0.2.1.tar.gz.

File metadata

  • Download URL: serpyco_rs-0.2.1.tar.gz
  • Upload date:
  • Size: 29.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.14.10

File hashes

Hashes for serpyco_rs-0.2.1.tar.gz
Algorithm Hash digest
SHA256 eee70e45a0269e3dc01d0900960ba242bf29d93af5afed82f5001d9ca6dc9c5e
MD5 a543de073e3c986f480a54a525cf87bd
BLAKE2b-256 237144a49c20689db09405a54a69062c52b4413926e464f7a1c4468c7c2527f2

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.2.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for serpyco_rs-0.2.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 491be2f6dc7cfe8ca71eca77904d8c9d76db6711dd5d790cc4590d8ee24f0057
MD5 cc4fa7c261388aedf7004abf284734d3
BLAKE2b-256 f411888b19040e577f4cdd4a77b25a8cc2c691e81cba0834daa16831efa2b187

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.2.1-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for serpyco_rs-0.2.1-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 787433f9409796f80d33dd87cca240354f8b26cd519010fb31a756cceb3a2195
MD5 4829f6116a73930b2ed619eefd98e7ec
BLAKE2b-256 ab038d9991acae65405c9732f8b97a5aa72e74282632b7fed6b45e78e8f832af

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for serpyco_rs-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 16dfbd40ab5359d8d97187fd824deb950d7203c9c1fa148ae45ac2d8d74c50ae
MD5 f10af0d831e46e6a9178e5f7b159e257
BLAKE2b-256 137298bd060a9ed0eda8aa11cdbe35f36dfabd9f626f5b458e849005a547b82d

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.2.1-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for serpyco_rs-0.2.1-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 9e577354de10b046e9b91ec31593eeb1c5cc6828aa1858f3f372e8e5d069bf47
MD5 d84d48c469c2c297635dd5b997798a26
BLAKE2b-256 550d25611e4e9019e95577cb44267aa468fb21166b6d7a57f528851197d13398

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.2.1-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for serpyco_rs-0.2.1-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 5fe0fbc42cabad683210d386f53e9642d44d52ee81d16c6b96b674e2235ce101
MD5 ce16c30230d65eb9566101e4c59c8e17
BLAKE2b-256 0da0181f80c61a6785146caa11044eddcadd7702f43bf6e39f82d63c926f21db

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for serpyco_rs-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 75033524611f8aeddd63dc26a3aefadea9207c42ea7b036f76a3bf7d50d2c020
MD5 d8f004a20c1aff263e55ab25fcd02771
BLAKE2b-256 74bd3e64cc0ef04c7f0c119a0a3c9162c850fb7d38a1932979c73e50cd5bd9b2

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.2.1-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for serpyco_rs-0.2.1-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d43b7c02441189f5b4c8982e6bb5e584994bf464b28ece1c9120a7b6900dde4b
MD5 ab5258f24bde21094b07726bc54c4829
BLAKE2b-256 737d0e1ce11057106594ccc477cb8f28a7035e465626c14e4635a3b129a0e112

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.2.1-cp39-none-win_amd64.whl.

File metadata

File hashes

Hashes for serpyco_rs-0.2.1-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 f985ced470b9eddfe9e55c9bea8658f063c1bc1edbcde67851f2716fad80f8ab
MD5 35d15d225e1367f31598f7b883d857f9
BLAKE2b-256 cc8d445b7dc051e267a5187ebe4d76b969bf3c04646792fffc0c2e95383dec4f

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for serpyco_rs-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aeb06a69e4330ef1a8286ce75cb0cc068bc5df35d3a54dbfdcd4eb0b84405060
MD5 50b48fb443627ecc13fe5ed48030562b
BLAKE2b-256 98ed730851c1a4ddbc8b572f730f62e960b1f4a53ff4e4db1d1e5e583596d4b5

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.2.1-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for serpyco_rs-0.2.1-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 762f9393162912b40cae8478930e4c6d58d6a497e12ed16380273713445f4407
MD5 e3a9b506587a028a2dc224a42d885632
BLAKE2b-256 55af8c20bdd7f400016e53589a34fea7d8a76e7303449cdb54f65407b6bed083

See more details on using hashes here.

Supported by

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