skillfed

types-channels

Typing stubs for channels

types-channels v4.3.0.20260518 268.6K downloads/30d#8,271 on PyPI37
Permissive license Apache-2.0 Active released

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-channels

uv

uv add types-channels

poetry

poetry add types-channels

Installing 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

Programming Language :: Python :: 3Typing :: Stubs Only

Tags

type stubs for channelsdjango channels typingchannels mypy supportwebsocket type checkingasgi type annotations
type-stubsdjango-ecosystem

More Software Development packages