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

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

Uploaded Source

Built Distributions

serpyco_rs-0.1.4-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.4-cp311-none-win_amd64.whl (176.6 kB view details)

Uploaded CPython 3.11 Windows x86-64

serpyco_rs-0.1.4-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.4-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (567.5 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.1.4-cp310-none-win_amd64.whl (176.6 kB view details)

Uploaded CPython 3.10 Windows x86-64

serpyco_rs-0.1.4-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.4-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (567.5 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.4-cp39-none-win_amd64.whl (176.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

serpyco_rs-0.1.4-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.4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (568.1 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.4.tar.gz.

File metadata

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

File hashes

Hashes for serpyco_rs-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b02aa9798dbc337bd431eb5fbd7267c3b7d20ba07f4fcaeb29a664ff1ce178df
MD5 9bbec4c51a5c6194ed1f1f5394c63324
BLAKE2b-256 21871ebb0e817578268e218ffa9bb71b17462bbafc91f508b7b32783634426b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for serpyco_rs-0.1.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a6894a20c08544fc5b906e29d74a58fd05e5fa8f5a43646237c16e114551dd2e
MD5 587ab00e2675c71a9dc334775cd7c06b
BLAKE2b-256 f6e1511efd6c0fedc06ba03edb0d3ed280197724700abbd98a078324ae2a1baf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for serpyco_rs-0.1.4-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 11a1eab337b1d70cfe411d5c43469423e791ee1c6a28ec516c1c9a32af845082
MD5 f72ceef64aa89a4d905b27ea1f7e53c5
BLAKE2b-256 3ef5bdae6cccf9b821228646be1ef12c1769b82f4706551a4e27d29362aa112b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for serpyco_rs-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 29be460047c95fea897788dca1145615500e8df1e4fa15b3b036ed58f5ee0d8c
MD5 e1bb53e733dadc6eb6fc9c8469c707ef
BLAKE2b-256 cff05ba0e5c72caa4709bf19130223df33ee4aed05a5e377ab853d31a73f89b4

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.1.4-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.1.4-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 76e2a3c11d271a5af7e63c71214df1f58e9b5a7870ff28e2f19771d260cff76a
MD5 3958a4ef08e471c0b580b5c5a362c055
BLAKE2b-256 83e3f7f556ab4ce246c27b9da0ac7ee30efd48d799d51c9c7ca1080381d6a3e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for serpyco_rs-0.1.4-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 577dc0d46f5d8962381792a6123bbfb2d0b404c3e8a122a5f3425f03c19a9bfe
MD5 aedf81f38734a106e8852b241ed775c5
BLAKE2b-256 a6a3927d4e40d51bc5072b829cf7e4e04b9b4e3042e0fddea1f97a63cf38370f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for serpyco_rs-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 da48f752a64779f6514e561036d2dc7ec206c38913a4d919a921f986bcbc113e
MD5 e697d1f2d4cd5a38640629e93d43ee4b
BLAKE2b-256 ac7add3f0e0a402a3ea884e6da2ee7c8d1e25ad09f244cb93443d39bf18adc8c

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.1.4-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.4-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 83d48f5de86e135cbbb5f538f24947c31ae93ebc71497be52be38c24d92f3845
MD5 6257d9fcdaad141d21bfc79326894934
BLAKE2b-256 8546d230eb272280dfd4bbb67e2f63633f54ff980067cbfa535508156e07bdcc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for serpyco_rs-0.1.4-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 62e9fcd643c88b97b36c50197a81384d69c4996ed6a1982cb95c65810f1b3bb5
MD5 72b3b5d9db0dc45d761f8c12004a5ecb
BLAKE2b-256 8e5ec1a4af95025ed42f8d42d59f7a7f4158ed0fea4bb8282f3153b859211adc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for serpyco_rs-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f170fbc6eee88f14ed87134e16db8ae40d684971cf20dc91bcb9937e7d4dd5b7
MD5 7363b30374d90e74c420c9553b9bc68d
BLAKE2b-256 78e109db406bd0e28701e19b27ac34d811d3d6eccae942c5ca04958e12b83269

See more details on using hashes here.

File details

Details for the file serpyco_rs-0.1.4-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.4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 9984caa646fc011ac8c4c602acde3d68161678d612c1c7a4837714d713b7cfb4
MD5 bd3de6ba5d4860e16abe4fe02385c9c5
BLAKE2b-256 d2083b11c115cdcd9d0560b7219aab1f73dd89b351b9d8f48e4bf40da27c3733

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