databind
The databind package provides a (de)serialization framework that understands most native Python types as well as
dataclasses, as well as an implementation for serialize to/from JSON-like nested data structures.
Databind is intended mostly for flexible and easy to use configuration loading. It does not try achieve high-performance; you should look towards e.g. mashumaro for this usecase.
Example
@dataclass
class Server:
host: str
port: int
@dataclass
class Config:
server: Server
from databind.json import dump, load
dict_payload = {"server": {"host": "localhost", "port": 8080}}
loaded = Config(server=Server(host="localhost", port=8080))
assert load(dict_payload, Config) == loaded
assert dump(loaded, Config) == dict_payload
Features ✨
- Support for a plethora of builtin types, including
Enum,Decimal,UUID,Path,datetime,date,time,timedelta - Support for multiple union serialization modes (nested, flat, keyed,
typing.Literal) - Support for generic types, e.g.
load([{"name": "Jane Doe"}], list[Person]) - Support for new-style type hints in older Python versions when using forward refererences (strings or
__future__.annotations) thanks to typeapi - Support for customized serialization and deserialization of types
- Support for flattening fields of a nested dataclass or collecting remaining fields in a
dict - Full runtime type checking during serialization
- Use "settings" to customize serialization behaviour
- As global settings per
load()/dump()call:load(..., settings=[ExtraKeys(True)]) - As class-level settings using a decorator:
@Union(style=Union.FLAT)or@ExtraKeys(True) - As type-hint level settings using
typing.Annotated(ortyping_extensions.Annotated):full_name: Annotated[str, Alias("fullName")]orFullNameField = Annotated[str, Alias("fullName")]
- As global settings per
Notable release notes
4.5.0
- Merged
databind.coreanddatabind.jsonpackages intodatabind. The old PyPI packages will remain as proxies until the next minor version. - Dropped support for Python 3.6 and 3.7.
Copyright © 2022 – Niklas Rosenstein
Metadata
Release files for databind 4.5.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| databind-4.5.5.tar.gz | 43.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| databind-4.5.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 96.4 kB
Release files / databind-4.5.5.tar.gz
| Download URL | databind-4.5.5.tar.gz |
|---|---|
| Size | 43.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
594c1b13b754c30f95faf85bba4a4cc5768243a6a9818a87a66a616d8848a54b
|
|
BLAKE2b-256 checksum How to use checksums |
164ac4bb226245299d22ef9ccde502cb658d318850e4fa7f4b0a416d3aa5324a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 22, 2026.
Transparency logRelease files / databind-4.5.5-py3-none-any.whl
| Download URL | databind-4.5.5-py3-none-any.whl |
|---|---|
| Size | 52.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78b5d740dcb2f457fbb8f09d989ce8c0917b44b60922751df61be0d0fe0660aa
|
|
BLAKE2b-256 checksum How to use checksums |
838991ccb7aa370b2b0bc85e45de267c4e3e5f3f7752883d462ea6c11cc92466
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 22, 2026.
Transparency log