Databind is a library inspired by jackson-databind to de-/serialize Python dataclasses. Compatible with Python 3.7 and newer.
Project description
databind.core
databind.core provides a jackson-databind inspired framework for data de-/serialization in Python. Unless you
are looking to implement support for de-/serializing new data formats, the databind.core package alone might
not be what you are looking for (unless you want to use databind.core.dataclasses as a drop-in replacement to
the standard library dataclasses module, for that check out the section at the bottom).
Known implementations
Dataclass extension
The standard library dataclasses module does not allow to define non-default arguments after default arguments.
You can use databind.core.dataclasses as a drop-in replacement to get this feature. It behaves exactly like the
standard library, only that non-default arguments may follow default arguments. Such arguments can be passed to
the constructor as positional or keyword arguments.
from databind.core import dataclasses
@dataclasses.dataclass
class A:
value1: int = 42
@dataclasses.dataclass
class B(A):
value2: str
print(B(0, 'Hello, World!'))
print(B(value2='Answer to the universe'))
Copyright © 2020 – Niklas Rosenstein
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file databind.core-4.2.2.tar.gz.
File metadata
- Download URL: databind.core-4.2.2.tar.gz
- Upload date:
- Size: 23.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.2 requests/2.28.1 requests-toolbelt/0.10.0 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/5.0.0 keyring/23.9.3 rfc3986/2.0.0 colorama/0.4.5 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f597c3077a649cf959a769588663be1532f6fa192f62e4963e8bc2c94ac3da2
|
|
| MD5 |
4a5d42497546c633031fcf78e02a4942
|
|
| BLAKE2b-256 |
79530a2e1f919f2e008ac42332671cf361e80908a27ca701c4c33d98091d7bd8
|
File details
Details for the file databind.core-4.2.2-py3-none-any.whl.
File metadata
- Download URL: databind.core-4.2.2-py3-none-any.whl
- Upload date:
- Size: 27.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.2 requests/2.28.1 requests-toolbelt/0.10.0 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/5.0.0 keyring/23.9.3 rfc3986/2.0.0 colorama/0.4.5 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b1073388e630a4d3b3b89c32da3e6ed9e3691e441777a2a0e9487c2e3abc5f5
|
|
| MD5 |
575a2ecc64dcc336b61d863d3270f523
|
|
| BLAKE2b-256 |
b8dcf8463c618237ea098e1c0c3d212441dc93df912afab71113dd5964bf9399
|