dacite
Simple creation of data classes from dictionaries.
Decision gist · record as of 2026-08-14
Yes, if you use dataclasses and frequently convert dictionaries to typed objects. The library is stable (Production/Stable status), has no known vulnerabilities, and installs with minimal friction. The aging maintenance status (555 days since last release) is a minor concern for a mature, narrow-purpose tool—monitor the repository if you depend on new features, but the core functionality is unlikely to break. Pair it with a validation library if you need to check data before conversion.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.7 or later; dataclasses are built-in to the standard library from Python 3.7 onward.
- Low friction installation with a single pure-Python dependency (dataclasses).
- Maintenance status is aging—last release was 555 days ago, though the repository remains active with a recent commit on 2025-03-17 and 2041 stars.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
last release 2025-02-05 (555 days) · last repo commit 2025-03-17 · 2,041 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 23,712,751 downloads/mo, #935 on PyPI
Alternatives
Verify before relying
from dataclasses import dataclass
from dacite import from_dict
@dataclass
class User:
name: str
age: int
data = {'name': 'John', 'age': 30}
user = from_dict(data_class=User, data=data)- Performance characteristics when handling very large or deeply nested structures.
- Compatibility with third-party type annotation libraries beyond the standard typing module.
What it is and what it does
Dacite is a lightweight library that bridges the gap between plain dictionaries and Python dataclasses. It takes a dictionary and a dataclass type, then instantiates the dataclass with the dictionary's values, handling type conversions and nested structures automatically. The library was designed to simplify creation of type-hinted data transfer objects (DTOs) that cross application boundaries—for example, converting JSON payloads from HTTP requests or database rows into strongly-typed Python objects.
The core function is `from_dict`, which accepts a dataclass type, input dictionary, and optional configuration. It supports nested dataclasses, optional fields, union types, generic dataclasses, type hooks for custom transformations, casting for enum-like conversions, and strict mode to reject unexpected keys. The library explicitly does not validate data; it assumes input is already valid or will be validated separately.
Use it for
- Convert JSON request payloads into dataclass instances for HTTP API handlers.
- Transform database query results (as dictionaries) into typed domain objects.
- Build type-safe configuration objects from YAML or JSON config files.
- Deserialize nested API responses into hierarchical dataclass structures.
- Create DTOs for inter-service communication with automatic type coercion.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use dataclasses and frequently convert dictionaries to typed objects.
The library is stable (Production/Stable status), has no known vulnerabilities, and installs with minimal friction. The aging maintenance status (555 days since last release) is a minor concern for a mature, narrow-purpose tool—monitor the repository if you depend on new features, but the core functionality is unlikely to break. Pair it with a validation library if you need to check data before conversion.
Install
dacite on PyPI
Before you install
Low friction installation with a single pure-Python dependency (dataclasses). Maintenance status is aging—last release was 555 days ago, though the repository remains active with a recent commit on 2025-03-17 and 2041 stars.
Requires Python 3.7 or later; dataclasses are built-in to the standard library from Python 3.7 onward.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
from dataclasses import dataclass
from dacite import from_dict
@dataclass
class User:
name: str
age: int
data = {'name': 'John', 'age': 30}
user = from_dict(data_class=User, data=data)
Verify before relying
- Performance characteristics when handling very large or deeply nested structures.
- Compatibility with third-party type annotation libraries beyond the standard typing module.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagedataclasses |
| Maintenance | Aging 555 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 23,712,751 / month, #935 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules |
Evidence: dacite-1.9.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “dataclass from dictionary”
- daciteConverts dictionaries into dataclass instances with support for…
- undictifyEnforces type annotations at runtime by wrapping function calls and…
- typed-json-dataclassAdds JSON serialization and type validation to Python dataclasses,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also class-resolver · typed-json-dataclass · databind · dataclasses · databind.json · dataclass-wizard · databind.core · dataclasses-json · dataclasses-json-speakeasy · dataclass-csv