djangorestframework-dataclasses
A dataclasses serializer for Django REST Framework
Decision gist · record as of 2026-08-14
Yes, if you use dataclasses as your primary data model layer in Django REST Framework projects. The package is stable and permissively licensed, with low install friction. The 457-day release gap suggests slower maintenance, so verify compatibility with your Django and DRF versions before adopting; otherwise it is a solid fit for eliminating serializer boilerplate.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django 3.2+ and Django REST Framework 3.11+; Python 3.7+ (description lists 3.8+ as tested minimum).
- Low friction install with three straightforward runtime dependencies (django, djangorestframework, typing_extensions).
- Maintenance status is aging—last release was 457 days ago—but the repository remains active and marked Production/Stable.
License · maintenance · safety
permissive license (permissive) — BSD-3-clause license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2025-05-14 (457 days) · last repo commit 2025-05-14 · 468 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,838,854 downloads/mo, #2,867 on PyPI
Alternatives
Verify before relying
pip install djangorestframework-dataclasses
from dataclasses import dataclass
from djangorestframework_dataclasses.serializers import DataclassSerializer
@dataclass
class Person:
name: str
email: str
class PersonSerializer(DataclassSerializer):
class Meta:
dataclass = Person- Whether the 457-day gap since last release indicates active maintenance or dormancy relative to Django/DRF release cycles.
- Support status for the latest versions of Django and Django REST Framework beyond what the description guarantees.
- Full scope of type annotations supported beyond str, bool, int, float, date, datetime, time, timedelta, Decimal, UUID, Enum, Iterable, Mapping, Literal, Union, and django.db.Model.
What it is and what it does
This package provides a DataclassSerializer that automatically generates Django REST Framework serializer fields from dataclass type annotations. Instead of manually declaring each field twice—once in the dataclass and again in a DRF Serializer—you define the dataclass with type hints and let the serializer introspect it. The package handles common Python types (str, bool, int, float, date, datetime, time, timedelta, Decimal, UUID, Enum, Literal, Union, Iterable, Mapping) and generates corresponding REST Framework fields, respecting optional fields, nullable types, and read-only markers.
It follows the ModelSerializer pattern familiar to Django developers: you specify the dataclass in a Meta subclass, optionally override or add fields, and get create() and update() implementations for free. The serializer works with the standard DRF workflow—calling .data for serialized output, .validated_data for deserialized instances, and save() to persist or update objects. This is most useful in projects that use dataclasses for domain models or DTOs rather than Django ORM models.
Use it for
- Serialize and deserialize dataclass-based domain models in REST APIs without duplicating field definitions.
- Build REST endpoints that accept and return typed dataclass instances instead of raw dictionaries.
- Reduce boilerplate when working with dataclasses as request/response DTOs in Django views or viewsets.
- Automatically validate incoming data against dataclass type annotations and constraints.
- Migrate from ModelSerializer-based APIs to dataclass-based architectures with minimal refactoring.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use dataclasses as your primary data model layer in Django REST Framework projects.
The package is stable and permissively licensed, with low install friction. The 457-day release gap suggests slower maintenance, so verify compatibility with your Django and DRF versions before adopting; otherwise it is a solid fit for eliminating serializer boilerplate.
Install
djangorestframework-dataclasses on PyPI
Before you install
Low friction install with three straightforward runtime dependencies (django, djangorestframework, typing_extensions). Maintenance status is aging—last release was 457 days ago—but the repository remains active and marked Production/Stable.
Requires Django 3.2+ and Django REST Framework 3.11+; Python 3.7+ (description lists 3.8+ as tested minimum).
License in practice
BSD-3-clause license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install djangorestframework-dataclasses
from dataclasses import dataclass
from djangorestframework_dataclasses.serializers import DataclassSerializer
@dataclass
class Person:
name: str
email: str
class PersonSerializer(DataclassSerializer):
class Meta:
dataclass = Person
Verify before relying
- Whether the 457-day gap since last release indicates active maintenance or dormancy relative to Django/DRF release cycles.
- Support status for the latest versions of Django and Django REST Framework beyond what the description guarantees.
- Full scope of type annotations supported beyond str, bool, int, float, date, datetime, time, timedelta, Decimal, UUID, Enum, Iterable, Mapping, Literal, Union, and django.db.Model.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesdjangodjangorestframeworktyping_extensions |
| Maintenance | Aging 457 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,838,854 / month, #2,867 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/StableEnvironment :: Web EnvironmentFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonTopic :: Internet :: WWW/HTTPTopic :: Software Development :: Libraries :: Application FrameworksTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: djangorestframework_dataclasses-1.4.0-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 serializer django rest framework”
- djangorestframework-dataclassesAutomatically generates Django REST Framework serializers from Python…
- drf-pydanticBridges pydantic models and Django REST framework by automatically…
- drf-writable-nestedExtends Django REST Framework serializers to handle creation and…
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 dataclasses · drf-pydantic · django-typomatic · jax-dataclasses · desert · drf-extra-fields · serpyco-rs · drf-flex-fields · rest-framework-generic-relations · dataclasses-json