rest-filters
rest-filters is an extension for Django REST Framework that parses query
parameters and constructs the corresponding QuerySet objects.
See full documentation at: https://rest-filters.readthedocs.io/
Installation
Use your favorite Python package manager to install rest-filters:
pip install rest-filters
rest-filters supports Django 4.2 and Django 5.2, with REST framework 3.14 and above.
rest-filters uses semantic versioning: https://semver.org
A basic example
Here is a basic FilterSet declaration that allows filtering users by username, company, and creation date.
Check out getting started guide for more details.
from rest_filters import Filter, FilterSet
from rest_framework import serializers
class UserFilterSet(FilterSet[User]):
username = Filter(serializers.CharField(min_length=2), lookup="icontains")
company = Filter(
namespace=True,
children=[
Filter(
serializers.IntegerField(min_value=1),
lookup="id",
),
Filter(
serializers.CharField(min_length=2),
lookup="name__icontains",
param="name",
),
],
)
created = Filter(
serializers.DateTimeField(),
namespace=True,
children=[
Filter(lookup="gte"),
Filter(lookup="lte"),
],
)
Metadata
Release files for rest-filters 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rest_filters-0.7.1.tar.gz | 16.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rest_filters-0.7.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.7 kB
Release files / rest_filters-0.7.1.tar.gz
| Download URL | rest_filters-0.7.1.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40ea4a4e5b05c4fa87156f6b1630426c14017acb6456b73e7684b82adc4aaeb2
|
|
BLAKE2b-256 checksum How to use checksums |
4c3ce2f209d34140870c20e6c7e484629b665eedca508e6a9813aabdb84fbb29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / rest_filters-0.7.1-py3-none-any.whl
| Download URL | rest_filters-0.7.1-py3-none-any.whl |
|---|---|
| Size | 22.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
800d20e01243195cada9c8b00a428d35d3200506d428ac613c2c49527a07c65b
|
|
BLAKE2b-256 checksum How to use checksums |
b4c6c4bbdf049d2c125441023cb99b321693dce53870436782665e5dca0f1d8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for rest-filters 0.7.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.