skillfed

drf-rw-serializers

Generic views, viewsets and mixins that extend the Django REST Framework ones adding separated serializers for read and write operations

drf-rw-serializers v1.4.0 74.9K downloads/30d#14,780 on PyPI181
Permissive license MIT AGING released

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-serializers

uv

uv add drf-rw-serializers

poetry

poetry add drf-rw-serializers

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

django rest framework read write serializersdrf separate serializers requests responsesdjango api different input output schemasdrf viewsets read write operationsdjango rest framework dual serializers
django-rest-frameworkserializationapi-design

More Application Frameworks packages

fastapi

FastAPI is a Python web framework for building…

permissive · top 100 on PyPI

annotated-doc

Provides a way to document function parameters,…

permissive · top 100 on PyPI

textual

Textual is a Python framework for building…

permissive · top 100 on PyPI

typer

Typer builds command-line applications from…

permissive · top 1,000 on PyPI

mcp

Build and connect to Model Context Protocol…

permissive · top 1,000 on PyPI

Werkzeug

Werkzeug is a WSGI utility library providing…

permissive · top 1,000 on PyPI

djangorestframework-bulk

Adds bulk create, update, and delete operations…

permissive · top 15,000 on PyPI

drf-extensions

Provides mixins, decorators, and utilities that…

permissive · top 5,000 on PyPI

drf-dynamic-fields

Provides a Django REST Framework mixin that…

permissive · top 15,000 on PyPI

djangorestframework

Builds web APIs on top of Django with…

permissive · top 1,000 on PyPI

drf-writable-nested

Extends Django REST Framework serializers to…

permissive · top 15,000 on PyPI

rest-framework-generic-relations

Provides Django REST Framework serializers that…

permissive · top 15,000 on PyPI

drf-exceptions-hog

Standardizes Django REST Framework exception…

permissive · top 5,000 on PyPI

adrf

Adds async/await support to Django REST…

permissive · top 15,000 on PyPI

drf-standardized-errors

Converts all Django REST Framework API error…

permissive · top 15,000 on PyPI

django-service-objects

Provides a Service base class for Django that…

permissive · top 15,000 on PyPI