Skip to main content

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

databind.core-1.1.3.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

databind.core-1.1.3-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

Details for the file databind.core-1.1.3.tar.gz.

File metadata

  • Download URL: databind.core-1.1.3.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.5

File hashes

Hashes for databind.core-1.1.3.tar.gz
Algorithm Hash digest
SHA256 8cdb8bb43bb046b764a6101f7c7fd6bd47d40c464a938d964ceaf8c5cd01361e
MD5 f9bb053f80ec0a212470c509f361af7e
BLAKE2b-256 c4b28185f6edf6aa8eb704226d2391df0e42c9ca50e89e39a095314d4775f5cc

See more details on using hashes here.

File details

Details for the file databind.core-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: databind.core-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 32.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.5

File hashes

Hashes for databind.core-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 92cc1af86531c42f2c36f7fbfc6631f130ac8b01fea83422727c1d9d2b18c200
MD5 b8861ba9f5a1b238ab4798b9dbd1961e
BLAKE2b-256 50e0719c7f320a1511856230237e5bd164d801cc21903956121556942c4ffd85

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page