skillfed

djangorestframework-types

Type stubs for Django Rest Framework

djangorestframework-types v0.9.0 379.7K downloads/30d#7,109 on PyPI55
Permissive license MIT AGING released

What it is and what it does

This package provides type stubs for Django Rest Framework, the popular REST API toolkit for Django. Type stubs are interface definitions that allow static type checkers like mypy and pyright to understand the types of Django Rest Framework's classes and functions, enabling developers to catch type errors during development rather than at runtime.

The package was forked from djangorestframework-stubs specifically to remove the mypy plugin dependency, which could crash when Django configuration issues arose. By providing pure stubs instead, it works with multiple type checkers—not just mypy—and avoids the fragility of plugin-based type checking. It has a single runtime dependency on typing_extensions and supports Python 3.8 through 3.12.

Use it for:

  • Add type checking to Django Rest Framework projects using mypy or pyright without installing a mypy plugin
  • Catch serializer, viewset, and API endpoint type errors during development before deployment
  • Enable IDE autocomplete and type hints for Django Rest Framework classes and methods
  • Migrate from an older type-stub package to a plugin-free alternative that works with multiple type checkers
  • Ensure type safety in REST API views and serializers across a team's codebase

Worth the install?

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

Provides type stubs for Django Rest Framework, enabling static type checking with mypy, pyright, and other type checkers without requiring a mypy plugin.

Yes, if you use Django Rest Framework and want static type checking. The low install friction, permissive license, and multi-checker support make it practical. However, the aging maintenance status (673 days since last release) means you should verify that type coverage matches your Django Rest Framework version before committing to it in a new project.

Install

djangorestframework-types on PyPI

pip

pip install djangorestframework-types

uv

uv add djangorestframework-types

poetry

poetry add djangorestframework-types

Installing djangorestframework-types

Before you install

Low install friction with a single lightweight dependency (typing_extensions). Maintenance status is aging—last release was 673 days ago, though the repository remains active.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.

Quickstart

pip install djangorestframework-types

import typing_extensions
# Type stubs are now available for Django Rest Framework type checking

Requires Python 3.8 or later; intended for use with a static type checker like mypy or pyright

Verify before relying

  • Whether type coverage is comprehensive across all Django Rest Framework versions and APIs
  • Compatibility with the latest Django Rest Framework releases and whether stubs are kept in sync
  • Whether pyright and other non-mypy checkers work as well as claimed compared to the original version

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — typing_extensions
Maintenance aging — 673 days since the last release
Last repo commit
First released
Downloads 379,713/month — #7,109 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: djangorestframework_types-0.9.0-py3-none-any.whl

Keywords: django, djangorestframework, types, mypy, stubs

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

django rest framework type stubsdjangorestframework typingdrf type hintsstatic type checking django restmypy django rest frameworkpyright django rest frameworktype annotations drf
type-stubsstatic-analysisdjango-ecosystem

More Quality Assurance packages