skillfed

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.

databind v4.5.5 259.2K downloads/30d#8,414 on PyPI15
Permissive license MIT Active released

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 databind

uv

uv add databind

poetry

poetry add databind

Installing 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

dataclass serialization deserializationjson to dataclass loadingpython config file parsingnested data structure bindingtype-safe data mappingdataclass json conversionconfiguration deserialization
dataclass-bindingconfig-loadingtype-safe-serialization

More Software Development packages