databind
Databind is a library inspired by jackson-databind to de-/serialize Python dataclasses. The `databind` package will install the full suite of databind packages. Compatible with Python 3.8 and newer.
What it is and what it does
Databind is a dataclass serialization library that converts between JSON-like nested dicts and Python dataclasses with full runtime type checking. It handles most native Python types—Enum, Decimal, UUID, Path, datetime variants, and more—plus generic types and custom serialization rules. The library is designed for flexible configuration loading rather than high-performance serialization; it supports multiple union modes, field flattening, and customization through global settings, class decorators, or type hints via Annotated.
You use it by defining dataclasses, then calling load() to deserialize a dict into a typed instance or dump() to serialize back. It understands forward references and new-style type hints (PEP 604 unions, PEP 585 generics) even on older Python versions through typeapi. The package recently merged its core and JSON modules into a single distribution.
Use it for:
- Load configuration files (YAML, TOML, JSON) into strongly-typed dataclass objects with validation.
- Deserialize API responses into dataclass instances with automatic type conversion and error handling.
- Serialize application state or settings back to JSON for storage or transmission.
- Handle complex nested data structures with custom union and field-flattening rules.
- Build CLI tools that accept structured config input and convert it to typed Python objects.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Databind deserializes JSON-like nested data structures into Python dataclasses and native types, and serializes dataclasses back to JSON-compatible dicts.
Yes, if you need flexible dataclass serialization for configuration or API work. The low install friction, active maintenance, MIT license, and zero known vulnerabilities make it a safe choice. Not recommended if you prioritize serialization speed—the docs explicitly point to mashumaro for high-performance use cases.
Install
databind on PyPI
pip
pip install databinduv
uv add databindpoetry
poetry add databindInstalling databind
Before you install
Low install friction with a pure-Python wheel and five runtime dependencies. Actively maintained with a recent release; last commit was 2026-05-22.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions.
Quickstart
pip install databind
from dataclasses import dataclass
from databind.json import load, dump
@dataclass
class Config:
host: str
port: int
data = {"host": "localhost", "port": 8080}
config = load(data, Config)
result = dump(config, Config)
Requires Python 3.8 or newer.
Verify before relying
- Performance characteristics compared to alternatives in real-world scenarios.
- Maturity and stability of the union serialization modes (nested, flat, keyed, Literal).
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — deprecated, nr-date, nr-stream, typeapi, typing-extensions |
| Maintenance | actively maintained — 84 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 259,237/month — #8,414 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: databind-4.5.5-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
databind.coreDeserializes and serializes Python dataclasses…
permissive · top 15,000 on PyPI
databind.jsonDeserializes and serializes Python dataclasses…
permissive · top 15,000 on PyPI
daciteConverts dictionaries into dataclass instances…
permissive · top 1,000 on PyPI
jsonsConverts Python objects (dataclasses, attrs…
permissive · top 5,000 on PyPI
serpyco-rsSerializes and deserializes Python dataclasses…
permissive · top 15,000 on PyPI
dataclass-factoryConverts dataclasses to and from dictionaries…
permissive · top 15,000 on PyPI
dataclass-wizardDataclass Wizard converts Python dataclasses to…
permissive · top 5,000 on PyPI
pyserdeSerialize and deserialize Python dataclasses to…
permissive · top 5,000 on PyPI
json-strong-typingSerializes Python dataclasses to JSON and…
permissive · top 15,000 on PyPI
typedloadLoads and dumps JSON-like data into typed…
copyleft · top 1,000 on PyPI