Skip to main content

Django Rest Framework Aggregation

A Django REST Framework mixin that adds an aggregation endpoint (count, sum, average, minimum, maximum) with grouping, filtering and ordering to your ViewSets.

uv add django-rest-aggregation
from django_rest_aggregation import AggregationMixin
from rest_framework.viewsets import GenericViewSet


class BookViewSet(AggregationMixin, GenericViewSet):
    queryset = Book.objects.all()
    serializer_class = BookSerializer
GET /book/aggregation/?aggregation=average&aggregation_field=rating&group_by=author

Based on kit-oz/drf-aggregation.

Documentation

The documentation is split into small linked notes in Readme/.

Using the package

  • Installation: install, dependencies, INSTALLED_APPS
  • Quickstart: add the mixin, register the route, example requests and responses
  • Query parameters: all URL parameters at a glance
  • Aggregations: aggregation types, aliases, allowed field types
  • Grouping: group_by, relation paths, multiple fields
  • Filtering: filtering before and after aggregation, value FilterSets
  • Ordering: ordering, allowed fields, pitfalls
  • Field access: which fields group_by / aggregation_field may use (aggregation_fields, aggregation_models), limits
  • Customization: value name, serializer, pagination, overridable hooks
  • View attributes: reference of all class attributes

Working on the package

License

MIT, see LICENSE.

Metadata

Release files for django-rest-aggregation 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-rest-aggregation 0.5.0
File Size Uploaded Provenance
django_rest_aggregation-0.5.0.tar.gz 15.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-rest-aggregation 0.5.0
File Interpreter ABI Platform
django_rest_aggregation-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.8 kB

Release files / django_rest_aggregation-0.5.0.tar.gz

Download URL django_rest_aggregation-0.5.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6224a1cd4b50e6da17f05caf0898c0407fc99425ac0b51e2579af72a9938fb3c
BLAKE2b-256 checksum
How to use checksums
97230fd2e96883b00bd8dc019618f209262c227fcebfef7730ac45493b2ea599
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / django_rest_aggregation-0.5.0-py3-none-any.whl

Download URL django_rest_aggregation-0.5.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9b69035769e63ab7474d7ab3972cd34aa4d79633f7a29752e414a2ac4ca7b65
BLAKE2b-256 checksum
How to use checksums
8849432eb0d294f120b4658f1e69bd1ca9f1c2588201f9b841326a2b09bef9be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Security for django-rest-aggregation 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_rest_aggregation-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page