--- id: dataclasses-json-speakeasy version: "0.5.11" license: MIT license_treatment: permissive maintenance: active --- # dataclasses-json-speakeasy — Easily serialize dataclasses to and from JSON. License: permissive · Maintenance: active · Downloads: 881.0K/mo ## What it is and what it does This library adds JSON serialization and deserialization methods to Python dataclasses through a simple decorator or mixin. It handles the boilerplate of converting dataclass instances to JSON strings or dictionaries, and reconstructing dataclass instances from JSON or dict input. The library supports nested dataclasses, standard collection types, and special types like datetime, UUID, and Decimal. You apply the @dataclass_json decorator above @dataclass (or inherit from DataClassJsonMixin), then call .to_json(), .to_dict(), .from_json(), or .from_dict() on your class or instances. It also provides schema-based validation through a .schema() method backed by marshmallow, and supports field-level and class-level configuration for naming conventions like camelCase-to-snake_case conversion. Use it for: - Serialize API request/response dataclasses to JSON for HTTP communication - Deserialize JSON payloads into typed dataclass instances with optional validation - Convert between Python snake_case field names and JSON camelCase conventions - Handle nested dataclass structures with automatic recursive encoding/decoding - Validate incoming JSON data against dataclass field types using schema validation ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Converts Python dataclasses to and from JSON with a decorator or mixin, supporting nested types, collections, datetime, UUID, and Decimal objects. Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a common problem cleanly. The MIT license imposes no restrictions. Install it if you need straightforward JSON serialization for dataclasses; the two-dependency footprint and decorator-based API make it a lightweight choice. ## Install pip install dataclasses-json-speakeasy uv add dataclasses-json-speakeasy poetry add dataclasses-json-speakeasy ## Installing dataclasses-json-speakeasy Before you install: Low friction: pure Python wheel with only two runtime dependencies (typing-inspect and marshmallow). Repository is active with recent commits and no archived status. 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-speakeasy from dataclasses import dataclass from dataclasses_json import dataclass_json @dataclass_json @dataclass class Person: name: str person = Person(name='alice') json_str = person.to_json() # '{"name": "alice"}' recovered = Person.from_json(json_str) # Person(name='alice') Verify before relying: - Whether datetime encoding/decoding behavior (naive to aware conversion via system timezone) matches your application's requirements - Performance characteristics when handling large nested dataclass hierarchies or collections ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 881.0K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags dataclass json serialization, serialize dataclasses to json, json encoding decoding dataclasses, python dataclass json converter, dataclass schema validation, camelcase snake_case json conversion, nested dataclass json, serialization, json, dataclass [View on SkillFed](https://skillfed.io/packages/dataclasses-json-speakeasy) · [View on PyPI](https://pypi.org/project/dataclasses-json-speakeasy/)