No project description provided
Project description
serpyco-rs: a serializer for python dataclasses
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.
Features
- Serialization and unserialization of dataclasses
- Validation of input/output data
- Very fast
Todo
- parse DateTime without timezone
- parse timezone for datetime.time
- run tests in CI
- CI checks (pylint, black, mypy, ...)
- more tests
- bench results
- ...
Project details
Release history Release notifications | RSS feed
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.1.tar.gz
(23.7 kB
view hashes)
Built Distributions
Close
Hashes for serpyco_rs-0.1.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f850713d8cf2ab95094398be1d997da96bdf4dfdb0e8a82eed93496394f3256e |
|
MD5 | 00d9e2ff34c247bc37aeecaf3e33f50a |
|
BLAKE2b-256 | d45026d485100baa2b78f812ee54179d2f5ee855db1328976e488c5b2b02e9f1 |
Close
Hashes for serpyco_rs-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb21a5a6a355351d0f71d733509609dc8442c2d4dfe5dae64fb8cbe35c199950 |
|
MD5 | 06e0340fdfed0401f35db8c8e8691f1b |
|
BLAKE2b-256 | e49ca8ca0920591476a864b9c276181b65e9a42bbb1475824160f7dbabeaa07c |
Close
Hashes for serpyco_rs-0.1.1-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8b6968f82121aa170b7a410993a3f9f2d497fb7791f1b68a3bb6a1a78bf41bd |
|
MD5 | e4072f4b36261ab0a10e93cacb8eeae5 |
|
BLAKE2b-256 | a1c4c4cc232e51839ba8a9443fde4b94feed0038b28f123f7e25b256df7e96aa |
Close
Hashes for serpyco_rs-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f211833a21235e4cda623aa9e1f38fa1872be000f66980efb030921bd55701b0 |
|
MD5 | 31afb894a83704939eb88c2be1e80495 |
|
BLAKE2b-256 | 501767ed0b84f6f402ec54a9ecf31fcb1ba9214decb429f2ce54d008e6417464 |
Close
Hashes for serpyco_rs-0.1.1-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d605dfd90dc858cdedb067bc49b67a0de163257fe789ae30dca07f866cf6690d |
|
MD5 | f4c89ea20d5ae56f250eff1288dce9cf |
|
BLAKE2b-256 | ca5ce91bddab22bb9a4bc743b7f67c9b863a8bb03ed2acd5e125fc40d85e7d47 |
Close
Hashes for serpyco_rs-0.1.1-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e87679befbcdd25767ffebd76a767eabf357b0b2f2f1815f007aa80005c1f741 |
|
MD5 | b99ee8bbcecf93381d8e79a1ea310bfc |
|
BLAKE2b-256 | 67a9f0b207af090b19fa4922417a86f5eb752520e71ac201fe700a80bf479401 |
Close
Hashes for serpyco_rs-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b37dc086ca06ba53b9c8e9ec9871b2f2bb0639189d1e1c328b2d93605e916cbc |
|
MD5 | 2805038028fac35dba2f320e5ab0ef4f |
|
BLAKE2b-256 | 90b1ba75fb55a4088c0e28134eb488d9b199de245ccb95e4d371db8e8be0b23a |
Close
Hashes for serpyco_rs-0.1.1-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c281ae92074e5eee787cd9aaac3aa8340a8850858a2a59fa1da9c268a98de85 |
|
MD5 | 55c550dfbdcc7c4e1a11a61ff00b8434 |
|
BLAKE2b-256 | 9690f624465c08399925699bf5f52d2336e31f502187cf4a39516aa28e7d8e83 |