skillfed

databind.json

De-/serialize Python dataclasses to or from JSON payloads. Compatible with Python 3.8 and newer. Deprecated, use `databind` module instead.

databind-json v4.5.5 246.3K downloads/30d#8,712 on PyPI15
Permissive license MIT Active released

What it is and what it does

databind.json is a (de)serialization framework designed for flexible configuration loading from JSON-like nested data structures. It maps between Python dataclasses and dictionaries, automatically handling native types (int, str, bool, etc.), standard library types (Enum, Decimal, UUID, Path, datetime, date, time, timedelta), and generic types like lists and unions. The package supports multiple union serialization modes, runtime type checking, and customization through global settings, class-level decorators, or type-hint annotations.

The package explicitly prioritizes ease of use and flexibility over performance—if you need high-speed serialization, the documentation recommends alternatives like mashumaro. It's intended primarily for configuration loading workflows where you want to load structured data into typed Python objects without boilerplate, and it handles nested dataclasses, field flattening, and extra-key collection out of the box.

Use it for:

  • Load configuration files (JSON, YAML-converted-to-dict) into typed dataclass objects with automatic type validation.
  • Deserialize API responses into dataclass instances while preserving type safety and handling nested structures.
  • Serialize dataclass instances back to JSON-compatible dictionaries for storage or transmission.
  • Handle union types and multiple serialization modes (nested, flat, keyed, Literal) in complex data schemas.
  • Customize field names and serialization behavior per-field using Annotated type hints without modifying dataclass definitions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Deserializes and serializes Python dataclasses to and from JSON-like nested data structures, supporting native Python types, enums, dates, UUIDs, and generic types with customizable serialization behavior.

Yes, if you need flexible, type-safe JSON deserialization into dataclasses with minimal setup. The package is actively maintained, has no known vulnerabilities, and low install friction. Not recommended if performance is critical—the maintainers explicitly direct high-speed use cases elsewhere. The package is marked deprecated in favor of the `databind` module, so verify that the newer package meets your needs before committing to this one.

Install

databind-json on PyPI

pip

pip install databind-json

uv

uv add databind-json

poetry

poetry add databind-json

Installing databind.json

Before you install

Low friction: pure Python wheel with a single runtime dependency (databind). Last release 84 days ago with active repository status.

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install databind.json

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; does not support Python 3.6 or 3.7.

Verify before relying

  • Performance characteristics relative to alternatives when handling large payloads or deeply nested structures.
  • Whether the package handles circular references or self-referential dataclass definitions.
  • Extent of validation and error reporting when encountering malformed or type-mismatched input data.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — databind
Maintenance actively maintained — 84 days since the last release
Last repo commit
First released
Downloads 246,287/month — #8,712 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: databind_json-4.5.5-py3-none-any.whl

Tags

dataclass json serializationpython dataclass deserializationjson to dataclass mappingtype-safe json loadingdataclass configuration loadingnested dataclass jsonpython type hints json
dataclass-serializationconfiguration-loadingtype-hints

More Software Development packages