Registry / type-stubs / django-filter-stubs

django-filter-stubs

JSON →
library0.1.3pypypiunverified

django-filter-stubs provides PEP-484 compatible type stubs for the popular `django-filter` library, enabling static type checking with tools like Mypy. The project is currently at version 0.2.0, but it has been officially archived by its maintainers, meaning no further development, updates, or releases are expected.

pip install django-filter-stubs
INSTALL
IMPORT
SIG · DJANGO-FILTER-STUB
D
django-filter-stubs
type-stubspythonv0.1.3
Install
6.0s avg
Import
Disk
134MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 134.7MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 6.0s · import 0.000s · 133MB
134MB installed
● package 134MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FilterSet
from django_filters_stubs import FilterSet
from django_filters_stubs import FilterSet

To use `django-filter-stubs`, simply install the package. Mypy will automatically discover and use the type stubs for `django-filter` and its submodules (like `django_filters.rest_framework`) during its static analysis pass. No explicit imports from `django_filter_stubs` are required. Ensure your Mypy configuration is set up correctly for Django projects, ideally using `django-stubs` if available, to handle Django's runtime 'magic'.

# mypy.ini or pyproject.toml # For mypy.ini: [mypy] plugins = mypy_django_plugin.main # If using django-stubs # For pyproject.toml: [tool.mypy] plugins = ["mypy_django_plugin.main"] # If using django-stubs # In your Django project's Python code: # This code would benefit from django-filter-stubs for type checking from django import forms from django_filters import FilterSet, CharFilter from django.db import models class Product(models.Model): name = models.CharField(max_length=255) description = models.TextField() class Meta: app_label = 'myapp' class ProductFilter(FilterSet): name = CharFilter(field_name='name', lookup_expr='icontains') class Meta: model = Product fields = ['name'] def get_filtered_products(request, queryset): product_filter = ProductFilter(request.GET, queryset=queryset) return product_filter.qs
Debug
Known issues
breakingThe `django-filter-stubs` project has been officially archived by its maintainers. This means no further development, bug fixes, or compatibility updates are expected.
fix
Consider migrating to `types-django-filter` (from typeshed, installed via `pip install types-django-filter`), which is actively maintained and provides current stubs for `django-filter`.
affects: 0.2.0 and later
breakingVersion 0.2.0 of `django-filter-stubs` dropped support for Python 3.7. Attempting to use this version with Python 3.7 may lead to unexpected errors or missing type information.
fix
Upgrade your Python environment to 3.8 or newer. Python 3.7 has reached its end-of-life.
affects: 0.2.0
gotchaDue to the project's archived status, the provided type stubs may become outdated quickly and might not accurately reflect the latest APIs or features of newer `django-filter` or Django versions. This can result in false positives or missed type errors in Mypy.
fix
If encountering type issues, manually inspect the `django-filter` source code or consider switching to the actively maintained `types-django-filter` package for up-to-date type definitions.
affects: 0.2.0 (all versions, due to lack of maintenance)
Upgrade
Version history
0.1.3latest on PyPI · released Mar 28, 2023
Audit
Dependencies
django-filterrequiredProvides type stubs for this library.
djangorequiredImplicit dependency for any Django project using django-filter.
mypyrequiredRequired for static type checking to utilize these stubs.
Agent activity
28 hits · last 30 days
node
24
OpenAI (training)
1
Resources
django-filter-stubs — pip install django-filter-stubs · libregistry