dataclasses-json (lidatong/dataclasses-json)
- 75.5M downloads/month on PyPI
- 1,481 GitHub stars, 94K dependents
- Bus factor: 1 (lidatong: 230 commits, next contributor: 12)
- Last commit: June 2024, last release: v0.6.7 (June 2024)
- Maintainer publicly stepped away (issue #568 — support notice, Nov 2025)
- Archive request filed (issue #569, Dec 2025)
- No Python 3.13+ support
- Broken with recent marshmallow releases
- 159 open issues, 30+ open PRs
A modern, lightweight Python library for serializing and deserializing dataclasses to/from JSON. Zero or minimal dependencies. Full Python 3.10+ support (including 3.13+).
@dataclass_jsondecorator — opt-in serialization for dataclassesto_json()/from_json()— instance and class methods for JSON conversionto_dict()/from_dict()— dict conversion without JSON string step- Nested dataclass support — recursive serialization/deserialization
- Collection types —
List,Dict,Set,Tuple,Optional,Union - Field configuration — rename fields (camelCase, custom names), exclude fields, default values
- Built-in type handlers —
datetime,date,time,UUID,Decimal,Enum,Path - Strict/lenient modes — configurable handling of unknown fields and type mismatches
- Schema generation — JSON Schema output from dataclass definitions
- Custom encoders/decoders — per-field or per-type hooks
- Letter case conversion — camelCase, snake_case, kebab-case automatic conversion
- Performance optimization — compiled serializers for hot paths
fieldmarshal/
├── __init__.py # Public API exports
├── core.py # @dataclass_json decorator, to_json/from_json/to_dict/from_dict
├── config.py # FieldConfig, GlobalConfig, letter case options
├── types.py # Type resolution, generic handling, Union/Optional dispatch
├── encoders.py # Built-in type encoders (datetime, UUID, Decimal, Enum, etc.)
├── decoders.py # Built-in type decoders (reverse of encoders)
├── schema.py # JSON Schema generation (post-MVP)
└── _compat.py # Python version compatibility (3.10-3.13+)
- Zero required dependencies — stdlib only for core functionality
- Type-hint driven — use
typing.get_type_hints()anddataclasses.fields()for introspection - No marshmallow dependency — unlike dataclasses-json, avoid marshmallow for schema validation
- Modern Python — target 3.10+ only, leverage
matchstatements,|union syntax,slots=True - Performance — cache type resolution and encoder/decoder lookups per class
| Feature | dataclasses-json | fieldmarshal |
|---|---|---|
| Dependencies | marshmallow, marshmallow-enum, typing-inspect | None (stdlib only) |
| Python support | 3.7-3.12 | 3.10+ (including 3.13+) |
| Type resolution | typing-inspect (fragile) | stdlib typing introspection |
| Maintenance | Abandoned | Active |
| API style | Mixin or decorator | Decorator only (cleaner) |
- Core library with all MVP features
- Comprehensive test suite (pytest)
- README with usage examples and migration guide from dataclasses-json
- Published on PyPI as
fieldmarshal - CI/CD via GitHub Actions
- PyPI:
fieldmarshal— AVAILABLE (verified 2026-03-14)