skillfed

djangorestframework-recursive

Recursive Serialization for Django REST framework

djangorestframework-recursive v0.1.2 267.2K downloads/30d#8,295 on PyPI367
Permissive license BSD DORMANT released

What it is and what it does

djangorestframework-recursive provides a RecursiveField that handles serialization and deserialization of recursive data structures in Django REST Framework. Instead of writing custom recursive logic or nested serializers, you can use RecursiveField as a child of a ListField to represent tree nodes, linked lists, or acyclic graphs. The package claims to support validation, deserialization, ModelSerializers, and multi-step recursive structures.

The package is in Pre-Alpha status and has been dormant since its latest release. It was tested against Python 2.7, 3.4, and 3.6; Django 1.8–2.0; and DRF 3.3–3.7. No runtime dependencies are required beyond Django and DRF themselves, making installation straightforward. However, the lack of recent maintenance and pre-release status mean compatibility with modern Python, Django, and DRF versions is unverified.

Use it for:

  • Serialize a tree of categories or organizational hierarchies in a REST API without manually nesting serializers
  • Handle linked-list structures like comment threads with replies in JSON responses
  • Deserialize and validate recursive JSON payloads representing graphs or nested structures
  • Build a ModelSerializer for Django models with self-referential foreign keys

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Adds a RecursiveField to Django REST Framework that serializes and deserializes tree structures, linked lists, and directed acyclic graphs without writing custom recursive logic.

No—unless you are maintaining legacy code on Django 1.8–2.0 and DRF 3.3–3.7. The package is Pre-Alpha, dormant since 2017, and untested against modern versions. For new projects, use built-in DRF nested serializers or a maintained alternative. The lack of recent updates and pre-release status create risk of incompatibility and unresolved bugs.

Install

djangorestframework-recursive on PyPI

pip

pip install djangorestframework-recursive

uv

uv add djangorestframework-recursive

poetry

poetry add djangorestframework-recursive

Installing djangorestframework-recursive

Before you install

Low install friction with no runtime dependencies. Dormant since July 2017; last commit August 2024 suggests minimal maintenance. Pre-Alpha status and lack of recent activity mean expect limited support for modern Django or DRF versions.

License in practice

BSD license is permissive; you can use, modify, and distribute this package freely in most contexts without restriction.

Quickstart

pip install djangorestframework-recursive

from djangorestframework_recursive.fields import RecursiveField

class TreeSerializer(serializers.Serializer):
    name = serializers.CharField()
    children = serializers.ListField(child=RecursiveField())

Requires Django and Django REST Framework to be installed separately; tested against Django 1.8–2.0 and DRF 3.3–3.7, but compatibility with modern versions is unverified.

Verify before relying

  • Whether RecursiveField works with current versions of Django (3.2+) and Django REST Framework (3.12+)
  • Whether validation and deserialization work as documented in the description excerpt
  • Whether multi-step recursive structures are production-ready or experimental

Package facts

License BSD (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 3,328 days since the last release
Last repo commit
First released
Downloads 267,185/month — #8,295 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: djangorestframework_recursive-0.1.2-py2.py3-none-any.whl

Development Status :: 2 - Pre-AlphaEnvironment :: Web EnvironmentFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Topic :: Internet :: WWW/HTTP

Tags

django rest framework recursive serializationtree serialization drfnested structure serializerrecursive field djangohierarchical data rest apigraph serialization django rest
django-rest-frameworkserializationtree-structures

More WWW/HTTP packages