--- id: databind version: "4.5.5" license: MIT license_treatment: permissive maintenance: active --- # 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. License: permissive · Maintenance: active · Downloads: 259.2K/mo ## 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 above — 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 pip install databind uv add databind 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_current - Install friction: low - Maintenance: active - Downloads: 259.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags dataclass serialization deserialization, json to dataclass loading, python config file parsing, nested data structure binding, type-safe data mapping, dataclass json conversion, configuration deserialization, dataclass-binding, config-loading, type-safe-serialization [View on SkillFed](https://skillfed.io/packages/databind) · [View on PyPI](https://pypi.org/project/databind/)