djangorestframework-queryfields
Serialize a partial subset of fields in the API
What it is and what it does
This package extends Django REST framework to let API clients specify which fields they want in responses using query parameters. Instead of always returning all fields, a client can request only what it needs—for example, requesting just id and username fields, or all fields except id. This reduces bandwidth and improves performance for clients working with large or deeply nested API responses.
The package integrates with Django REST framework serializers and has no runtime dependencies beyond Django and DRF themselves, making it lightweight to add to existing projects. Maintenance is dormant but the repository is not archived, with 223 GitHub stars since its 2016-10-19 release.
Use it for:
- Mobile apps requesting minimal data to reduce network traffic and battery consumption.
- Frontend applications fetching large objects but only needing specific fields for display.
- API clients with bandwidth constraints selecting only required fields to optimize payload size.
- Building flexible APIs where different clients have different field requirements without multiple endpoints.
- Debugging and testing by requesting specific fields to inspect API structure.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Allows Django REST framework API clients to request only specific fields in responses via query parameters, reducing payload size.
Yes, if you use Django REST framework and want to give clients control over response fields. The package is stable, has no dependencies, and solves a real bandwidth problem. The dormant maintenance status is not a blocker since the code is mature; verify compatibility with your specific Django 1.7 - 3.2+ and DRF versions before adopting.
Install
djangorestframework-queryfields on PyPI
pip
pip install djangorestframework-queryfieldsuv
uv add djangorestframework-queryfieldspoetry
poetry add djangorestframework-queryfieldsInstalling djangorestframework-queryfields
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2023-11-22, over 996 days ago, though the repository remains active with recent commits and is not archived.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open and proprietary projects with minimal obligations.
Quickstart
pip install djangorestframework-queryfields
# In your Django REST framework serializer, use the package to filter fields
# Client requests: GET /users/?fields=id,username
Requires Django 1.7 - 3.2+ and Django REST framework installed separately.
Verify before relying
- Which specific module or class name to import and use from the package.
- Current compatibility with Django versions beyond 3.2 and modern Python releases.
- Whether exclusion syntax (fields!=id) is supported or only inclusion.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 996 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 95,994/month — #13,237 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: djangorestframework_queryfields-1.1.0-py2.py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
fastapi-filterAdds declarative filtering, sorting, and…
permissive · top 15,000 on PyPI
djangorestframeworkBuilds web APIs on top of Django with…
permissive · top 1,000 on PyPI
drf-api-loggerCaptures and logs Django REST Framework API…
permissive · top 15,000 on PyPI
marshmallow-unionAdds union field support to marshmallow,…
permissive · top 5,000 on PyPI
apischemaApischema handles JSON…
permissive · top 15,000 on PyPI
django-cloneDuplicates Django model instances with…
permissive · top 15,000 on PyPI
colcon-package-selectionExtends colcon-core to filter and select a…
permissive · top 15,000 on PyPI
validator-collectionProvides 60+ validator functions for checking…
permissive · top 15,000 on PyPI
drf-dynamic-fieldsProvides a Django REST Framework mixin that…
permissive · top 15,000 on PyPI
azure-functionsProvides Python bindings and decorators for…
permissive · top 5,000 on PyPI