skillfed

celery-types

Type stubs for Celery and its related packages

celery-types v0.26.0 3.5M downloads/30d#2,587 on PyPI156
Permissive license Apache-2.0 Active released

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

uv

uv add celery-types

poetry

poetry add celery-types

Installing 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

License :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Stubs OnlyTyping :: Typed

Tags

celery type stubscelery mypy typescelery type hintscelery static type checkingkombu type stubsamqp type annotationscelery typing support
type-stubscelerystatic-typing

More Software Development packages