celery-types
Type stubs for Celery and its related packages
What it is and what it does
celery-types is a type-stub package that adds static type information to Celery and its ecosystem of related libraries. It enables type checkers like mypy and basedpyright to understand the APIs of Celery, kombu, amqp, billiard, vine, django-celery-results, and ephem, catching type errors at development time rather than runtime.
The package is pure stubs—it contains no runtime code and depends only on typing-extensions. Installation is straightforward, but the stubs require a monkey-patch workaround to support generic type parameters on key Celery classes like Task, AsyncResult, and Signature. This is a one-time setup step documented in the package's README.
Use it for:
- Add type checking to a Celery application to catch task signature and result-handling errors before deployment.
- Enable IDE autocomplete and type hints for Celery task definitions and async result operations.
- Validate kombu message broker interactions and amqp protocol usage in type-safe code.
- Support mypy or basedpyright in a Django project using django-celery-results for task result storage.
- Integrate Celery into a strictly typed codebase without disabling type checking for Celery imports.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides type stubs for Celery and related packages (kombu, amqp, billiard, vine, django-celery-results, ephem) to enable static type checking in projects using these libraries.
Yes, if you use Celery or its related packages and want static type checking. The package is actively maintained, has no vulnerabilities, installs with minimal friction, and is permissively licensed. The required monkey-patch is a one-time setup documented in the README. Install it as a dev dependency to catch type errors early.
Install
celery-types on PyPI
pip
pip install celery-typesuv
uv add celery-typespoetry
poetry add celery-typesInstalling celery-types
Before you install
Installs with minimal friction—a pure Python wheel with only typing-extensions as a runtime dependency. Actively maintained with a recent release and no known vulnerabilities.
License in practice
Apache-2.0 permissive license allows use in most commercial and open-source projects without significant restriction.
Quickstart
pip install celery-types
from celery import Celery
from celery.app.task import Task
# Monkey patch to enable generic parameters (see docs for full class list)
setattr(Celery, "__class_getitem__", classmethod(lambda cls, *args, **kwargs: cls))
setattr(Task, "__class_getitem__", classmethod(lambda cls, *args, **kwargs: cls))
Requires Python 3.10 or later. Monkey patching of Celery classes is necessary to use generic type parameters with these stubs.
Verify before relying
- Whether the monkey-patch workaround is required for all use cases or only when using generic type parameters.
- Coverage completeness: which Celery and related package APIs are fully typed versus partially stubbed.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<4,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — typing-extensions |
| Maintenance | actively maintained — 155 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,537,228/month — #2,587 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: celery_types-0.26.0-py3-none-any.whl
Keywords: celery, kombu, vine, amqp, billiard, django_celery_results, types, mypy, stubs
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
msgpack-typesProvides type stubs for msgpack to enable…
permissive · top 15,000 on PyPI
celery-stubsProvides type stubs for Celery to enable static…
permissive · top 15,000 on PyPI
djangorestframework-typesProvides type stubs for Django Rest Framework,…
permissive · top 15,000 on PyPI
django-typesProvides type stubs for Django to enable static…
permissive · top 5,000 on PyPI
django-stubs-extProvides runtime monkey-patching extensions for…
permissive · top 5,000 on PyPI
django-celery-resultsStores Celery task results in a Django database…
permissive · top 5,000 on PyPI
types-smorestProvides type stubs for flask-smorest, enabling…
copyleft · top 5,000 on PyPI
google-api-python-client-stubsProvides type stubs for…
permissive · top 5,000 on PyPI
types-sqlalchemy-utilsProvides type stubs for sqlalchemy-utils,…
copyleft · top 5,000 on PyPI
types-pysaml2Provides type annotations (stubs) for the…
copyleft · top 15,000 on PyPI