$npx skillfedfor your agent

dataclasses-json

Easily serialize dataclasses to and from JSON.

Worth itPyPI Released Jun 202467.7M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — dataclasses_json-0.6.7-py3-none-any.whl
v0.6.7 · released 2024-06-09 · Python <4.0,>=3.7 · 2 runtime deps: marshmallow, typing-inspect

Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a genuine pain point in JSON serialization for typed Python code. The MIT license carries no restrictions. Install it if you work with dataclasses and JSON; the decorator is simple to apply and the API is straightforward.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction: pure Python wheel with only two runtime dependencies (marshmallow and typing-inspect).
  • Actively maintained with recent commits; last release 796 days ago suggests stable maturity rather than abandonment.

License · maintenance · safety

MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

last release 2024-06-09 (796 days) · last repo commit 2026-05-05 · 1,486 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 67,739,139 downloads/mo, #480 on PyPI

Verify before relying

pip install dataclasses-json

from dataclasses import dataclass
from dataclasses_json import dataclass_json

@dataclass_json
@dataclass
class Person:
    name: str

person = Person(name='lidatong')
person.to_json()  # '{"name": "lidatong"}'
Person.from_json('{"name": "lidatong"}')  # Person(name='lidatong')
  • Whether datetime encoding/decoding behavior (naive to aware conversion via system timezone) matches your application's requirements
  • Performance characteristics when handling deeply nested dataclass structures or large collections
Same gist for agents: .md · .json

What it is and what it does

Dataclasses JSON is a decorator-based library that adds `.to_json()`, `.from_json()`, `.to_dict()`, and `.from_dict()` methods to Python dataclasses. It handles the boilerplate of serializing dataclass instances to JSON strings or dictionaries and deserializing JSON back into typed dataclass objects, with support for nested dataclasses, collections, datetime, UUID, and Decimal types.

The library sits between your dataclass definitions and the standard json module, letting you work with strongly-typed Python objects while transparently converting to/from JSON. It supports field-level and class-level configuration for naming conventions (e.g., camelCase to snake_case mapping) and optional schema validation via marshmallow integration, which can catch type mismatches that plain dataclass construction would allow.

Use it for

  • Deserialize JSON API responses into typed dataclass objects for type-safe downstream processing
  • Serialize dataclass instances to JSON for HTTP responses or file storage without manual dict construction
  • Convert between snake_case Python field names and camelCase JSON conventions in web APIs
  • Validate incoming JSON against dataclass field types using schema validation before object creation
  • Handle nested dataclass hierarchies with automatic recursive encoding and decoding

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a genuine pain point in JSON serialization for typed Python code. The MIT license carries no restrictions. Install it if you work with dataclasses and JSON; the decorator is simple to apply and the API is straightforward.

Install

dataclasses-json on PyPI

Before you install

Low friction: pure Python wheel with only two runtime dependencies (marshmallow and typing-inspect). Actively maintained with recent commits; last release 796 days ago suggests stable maturity rather than abandonment.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install dataclasses-json

from dataclasses import dataclass
from dataclasses_json import dataclass_json

@dataclass_json
@dataclass
class Person:
    name: str

person = Person(name='lidatong')
person.to_json()  # '{"name": "lidatong"}'
Person.from_json('{"name": "lidatong"}')  # Person(name='lidatong')

Verify before relying

  • Whether datetime encoding/decoding behavior (naive to aware conversion via system timezone) matches your application's requirements
  • Performance characteristics when handling deeply nested dataclass structures or large collections

Package facts

LicenseMIT permissive
Python supportSupports the current Python release <4.0,>=3.7
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
marshmallowtyping-inspect
MaintenanceActively maintained 796 days since the last release
Last repo commit
First released
Downloads67,739,139 / month, #480 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Evidence: dataclasses_json-0.6.7-py3-none-any.whl

Tags

Capabilities
dataclass json serializationconvert dataclass to jsonjson schema validation pythonserialize python objects jsondataclass encoder decoder
Topics
serializationjson-conversiontype-safety

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 › “convert dataclass to json”

Give your agent the search over MCP, or paste the wish link into any chat.

Similar packages

dataclasses-json-speakeasy Worth it
PyPI · Software Development · released Feb 2024

Converts Python dataclasses to and from JSON with a decorator or mixin, supporting nested types, collections, datetime, UUID, and Decimal objects.

Install it if you need straightforward JSON serialization for dataclasses; the two-dependency footprint and decorator-based API make it a lightweight choice.

MITpure Python
881.0Kdownloads / mo
typed-json-dataclass With conditions
PyPI · Python Modules · released Jul 2019

Adds JSON serialization and type validation to Python dataclasses, letting you convert between dataclass instances and JSON/dict representations with automatic type checking.

MITpure Pythonabandoned
96.0Kdownloads / mo
dataclass-wizard Worth it
PyPI · Software Development · released Jul 2026

Dataclass Wizard converts Python dataclasses to and from JSON, YAML, TOML, and environment variables with automatic type coercion and case transformation, using code-generated serialization for performance.

Install it if you need JSON/YAML/TOML/environment variable marshalling for dataclasses and want automatic type coercion and case transformation out of the box.

Apache-2.0pure Python · 3.9+
4.9Mdownloads / mo
pyserde Worth it
PyPI · Software Development · released Aug 2026

Serialize and deserialize Python dataclasses to and from JSON, YAML, TOML, MsgPack, Pickle, and dict formats using a decorator-based API.

MITpure Python
1.3Mdownloads / mo
dacite With conditions
PyPI · Python Modules · released Feb 2025

Converts dictionaries into dataclass instances with support for nested structures, type checking, optional fields, unions, generics, and custom type hooks.

MITpure Python · 3.7+aging
23.7Mdownloads / mo
datafiles Worth it
PyPI · Software Development · released Jan 2026

Datafiles is a file-based ORM that automatically synchronizes Python dataclasses to disk files (YAML, JSON, TOML, JSON5) and back, treating the filesystem as a bidirectional persistence layer with minimal boilerplate.

Install it if you need automatic file-based persistence for configuration, state, or fixtures; skip it if you require a traditional database or need Python versions…

MITpure Python
133.5Kdownloads / mo

See also databind.json · dataclass-csv · djangorestframework-dataclasses · databind