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
File details
Details for the file databind_core2-4.2.2.tar.gz
.
File metadata
- Download URL: databind_core2-4.2.2.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.1 Darwin/22.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfc963930a557351be62f7cff8278088187ff778647370d5d7c661c7fab9b76d |
|
MD5 | 1d8813f7bb5b7a42be5be0065cc9b2c6 |
|
BLAKE2b-256 | 17dda573c2a184bde42b071cf2ca4fdab81ba81334c3f79bfe248422b5ed48f7 |
File details
Details for the file databind_core2-4.2.2-py3-none-any.whl
.
File metadata
- Download URL: databind_core2-4.2.2-py3-none-any.whl
- Upload date:
- Size: 27.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.1 Darwin/22.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbdadca665c9892edcbb5b465d6a63ca3d12bbd4fccb798118a10ffea4affcea |
|
MD5 | 26d6ebb820fd10c4ce8ed161a485b38b |
|
BLAKE2b-256 | 10808f308255e5b21a67df25e28395fa21e905f5778b8f31880e6e27f81c3485 |