Skip to main content

No project description provided

Project description

serpyco-rs: a serializer for python dataclasses

PyPI version Python versions

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

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)

Todo

  • omit_none
  • run tests in CI
  • CI checks (pylint, black, mypy, ...)
  • more tests
  • bench results
  • write docs
  • ...

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.1.3.tar.gz (27.3 kB view details)

Uploaded Source

Built Distributions

serpyco_rs-0.1.3-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.1.3-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.1.3-cp310-none-win_amd64.whl (175.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

serpyco_rs-0.1.3-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.1.3-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (566.8 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.1.3-cp39-none-win_amd64.whl (176.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

serpyco_rs-0.1.3-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.1.3-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (567.3 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.1.3.tar.gz.

File metadata

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

File hashes

Hashes for serpyco_rs-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e57b13dc00d8b3d7aff8e065f300d82175d3cd45d755207f34ded4b1ad1518d2
MD5 badff771c7aaeb35a61a4bd90f3231f7
BLAKE2b-256 2ed3669142f4b50bef73b68fc42be1a78376141b9949216f86d85d37490da827

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for serpyco_rs-0.1.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d1ecb71d6c236befa24b4ab264d828691c7c1cd8196239da9b37974c75a179b6
MD5 30ae57f37684f720bd9d7aafe2795d48
BLAKE2b-256 58c928e7a5650031d809eee6452024b0595573b53995ae5fbaffc967697ca7ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for serpyco_rs-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a98a57356a4592ade76ee7cefc8174902b05b4e5f9ddc23a0c1190e92ed8cfbf
MD5 0722ce4d821e2205feb2646f98aa7d7d
BLAKE2b-256 ce081c3365340f07a0e07dcf520921858360288c9c1d316c24b8ca4f36812100

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for serpyco_rs-0.1.3-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 2414a8acae6e781923ab50920188fc8dccedc504c272f6f0423fc88133d4d633
MD5 f7dda5a66f9491e92c11091419a6a681
BLAKE2b-256 32668615676c5e44e5d2c583e6463ed4f278a80662caebee248f855e1e23c07e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for serpyco_rs-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c5caf26a60ac8f2118e06796ea5b05c510aeb378ee53427698a4b6b41a9d4a8d
MD5 0dcb4c2125f511524725cd2b5b1965b8
BLAKE2b-256 a62cb9954ab97e142fde8bc5b6b090a75245ede84f0cf5baadafa7e821bac511

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.1.3-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.1.3-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 f11093de713d2420b3d93a796da6cad2e30004dd6e8a921af5536362ba52e576
MD5 c2edf35506fddd481413231a706631b6
BLAKE2b-256 0ebf5304ce4bf695a931a1bb302096c8a14eaa4b246f4d340deccac0f1bd0195

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for serpyco_rs-0.1.3-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 4787db2ec404526f961420b4c42595eadd8847776c07a7e8c185469ff9a01b19
MD5 f44d5c95841081001eccdf25906a4517
BLAKE2b-256 8c0cad898e5a6e58545cfda1455ea1aa9e00a32f2d3ba740ebaa76a0845d964c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for serpyco_rs-0.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bb135651a0931c384284115d0570a1174e0142989b511258fd95b473275d2445
MD5 6d37446bd372e1cc8c2b4a10680f43b5
BLAKE2b-256 79b4ab6ee1d9c5d4a9585afcf7a2291a0abcfec282c0b71e6d4d5b71b126dcb4

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.1.3-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.1.3-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d869ab02f17680be5e13a9d52320171733de7b72b700a48279429214904b208f
MD5 d988502b3238f5df04878d36b33fb376
BLAKE2b-256 141a0192fa061cf8588073c7a45a01c47249c6a4a7f5453fab6a4841aa9f4523

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