drf-rw-serializers
Generic views, viewsets and mixins that extend the Django REST Framework ones adding separated serializers for read and write operations
What it is and what it does
drf-rw-serializers is a Django REST Framework extension that allows you to define separate serializers for read (response) and write (request) operations in your API views and viewsets. Instead of forcing a single serializer to handle both input validation and output representation, you can optimize each independently—for example, using a lightweight serializer for writes and a richer one for reads with nested relationships or computed fields.
The package provides drop-in replacements for djangorestframework's generic views, viewsets, and mixins that automatically route requests to your read_serializer_class or write_serializer_class as appropriate. It has a single runtime dependency on djangorestframework and supports Python 3.8, 3.9, 3.10, 3.11, and 3.12. The codebase is stable but aging, with the last release 799 days ago; however, the repository remains maintained with recent commits.
Use it for:
- API endpoints where write requests need minimal fields but responses include computed or nested data.
- Separating input validation logic from output representation in complex djangorestframework projects.
- Reducing payload size on write operations while enriching read responses with related objects.
- Implementing different permission or field-level logic for incoming vs. outgoing serialization.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extends Django REST Framework with separate read and write serializers for generic views, viewsets, and mixins, allowing different serialization logic for request and response operations.
Yes, if you are building a djangorestframework API and need different serialization schemas for requests and responses. The package is straightforward to integrate, has low install friction, and solves a real architectural problem. However, note that maintenance is aging—the last release was 799 days ago—so verify compatibility with your current djangorestframework and Django versions before adopting.
Install
drf-rw-serializers on PyPI
pip
pip install drf-rw-serializersuv
uv add drf-rw-serializerspoetry
poetry add drf-rw-serializersInstalling drf-rw-serializers
Before you install
Low install friction with a single runtime dependency on djangorestframework. Maintenance status is aging—last release was 799 days ago, though the repository remains active with a recent commit on 2025-03-06 and no archived status.
License in practice
MIT license (permissive) permits commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license text.
Quickstart
pip install drf-rw-serializers
from drf_rw_serializers.generics import GenericViewSet
class MyViewSet(GenericViewSet):
read_serializer_class = MyReadSerializer
write_serializer_class = MyWriteSerializer
Requires djangorestframework to be installed and configured; intended for use within a Django project with djangorestframework already set up.
Verify before relying
- Whether the package supports the latest djangorestframework versions and any recent breaking changes.
- Performance characteristics when handling large datasets with separate read/write serializers.
- Specific Django version compatibility beyond what the classifiers indicate.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — djangorestframework |
| Maintenance | aging — 799 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 74,870/month — #14,780 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: drf_rw_serializers-1.4.0-py3-none-any.whl
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
djangorestframework-bulkAdds bulk create, update, and delete operations…
permissive · top 15,000 on PyPI
drf-extensionsProvides mixins, decorators, and utilities that…
permissive · top 5,000 on PyPI
drf-dynamic-fieldsProvides a Django REST Framework mixin that…
permissive · top 15,000 on PyPI
djangorestframeworkBuilds web APIs on top of Django with…
permissive · top 1,000 on PyPI
drf-writable-nestedExtends Django REST Framework serializers to…
permissive · top 15,000 on PyPI
rest-framework-generic-relationsProvides Django REST Framework serializers that…
permissive · top 15,000 on PyPI
drf-exceptions-hogStandardizes Django REST Framework exception…
permissive · top 5,000 on PyPI
adrfAdds async/await support to Django REST…
permissive · top 15,000 on PyPI
drf-standardized-errorsConverts all Django REST Framework API error…
permissive · top 15,000 on PyPI
django-service-objectsProvides a Service base class for Django that…
permissive · top 15,000 on PyPI