types-channels
Typing stubs for channels
What it is and what it does
types-channels is a type stub package that bridges the gap between the Django Channels library and static type checkers. It provides type annotations for channels so that tools like mypy and pyright can understand and validate code that uses Channels' WebSocket consumers, async utilities, and ASGI integration. The stubs are maintained as part of the typeshed project and are generated from typeshed's authoritative stub definitions.
You install this package alongside channels itself, and your type checker automatically uses the stubs to catch type errors in code that imports from channels. It depends on django-stubs and asgiref, matching the type annotation needs of those underlying libraries. The package targets channels 4.3.* specifically, so version alignment matters.
Use it for:
- Enable mypy or pyright to type-check Django Channels consumer code and catch type errors before runtime.
- Provide IDE autocomplete and inline type hints for channels APIs in editors that support type stubs.
- Validate async WebSocket handler signatures and message passing in a channels-based real-time application.
- Ensure type safety when integrating channels with django-stubs in a fully type-annotated Django project.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides type stubs for the channels package, enabling static type checkers like mypy and pyright to validate code that uses Django Channels for WebSocket and async communication.
Yes, if you use Django Channels and run a static type checker. This is a low-friction stub package with no security issues, permissive licensing, and active maintenance. Install it whenever you have channels in your project and want type checking to work correctly—it's a straightforward dependency with no runtime overhead.
Install
types-channels on PyPI
pip
pip install types-channelsuv
uv add types-channelspoetry
poetry add types-channelsInstalling types-channels
Before you install
Low friction installation as a pure-Python stub package. Actively maintained within the typeshed project with recent releases; last commit 2026-08-14.
License in practice
Apache-2.0 permissive license allows use in most projects, commercial or open-source, with minimal restrictions.
Quickstart
pip install types-channels
# In your code, import channels normally; type checkers will use the stubs
import channels
from channels.generic.websocket import AsyncWebsocketConsumer
Requires Python 3.10 or later. Type checking requires mypy 2.1.0, pyright 1.1.409, or compatible type checker installed separately.
Verify before relying
- Whether stubs cover all public channels APIs or only a subset of the 4.3.* release series.
- Compatibility with type checkers other than mypy 2.1.0 and pyright 1.1.409.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — django-stubs, asgiref |
| Maintenance | actively maintained — 88 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 268,636/month — #8,271 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: types_channels-4.3.0.20260518-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
types-mockProvides type stubs for the mock library,…
permissive · top 5,000 on PyPI
types-MarkdownProvides type stubs for the Markdown package,…
permissive · top 5,000 on PyPI
types-html5libProvides type hints for the html5lib HTML…
permissive · top 5,000 on PyPI
channelsChannels augments Django with WebSocket,…
permissive · top 5,000 on PyPI
types-pexpectProvides type stubs for pexpect, enabling type…
permissive · top 5,000 on PyPI
types-qrcodeProvides type stubs for the qrcode package,…
permissive · top 15,000 on PyPI
types-protobufProvides type stubs for the protobuf package,…
permissive · top 1,000 on PyPI
types-cffiProvides type stubs for the cffi package,…
permissive · top 5,000 on PyPI
types-PySocksProvides type stubs for PySocks, enabling…
permissive · top 15,000 on PyPI
types-polibProvides type stubs for the polib package,…
permissive · top 15,000 on PyPI