taskiq-fastapi
FastAPI integration for taskiq
Decision gist · record as of 2026-08-14
Yes, if you are already using both FastAPI and taskiq and want to share dependency injection logic between them. The low install friction, permissive license, and active maintenance make it a reasonable choice. Be aware it is classified as Alpha, so expect potential API changes. Verify that the synthetic Request object meets your dependency needs before committing to production use.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Requires a running taskiq broker (e.g., ZeroMQ, Redis) and FastAPI application instance.
- Low install friction with only two runtime dependencies (taskiq and fastapi).
License · maintenance · safety
MIT (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
last release 2026-04-18 (118 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 225,315 downloads/mo, #9,222 on PyPI
Alternatives
Verify before relying
pip install taskiq-fastapi
import taskiq_fastapi
from taskiq import ZeroMQBroker
from fastapi import FastAPI
broker = ZeroMQBroker()
app = FastAPI()
taskiq_fastapi.init(broker, "myapp:app")- Whether the synthetic Request object created by init() is sufficient for all FastAPI dependency patterns in production workloads.
- Performance characteristics when dependency context is large or frequently updated.
- Compatibility with FastAPI versions beyond those tested during development.
What it is and what it does
taskiq-fastapi bridges FastAPI's dependency injection system with taskiq's distributed task queue. It allows task functions to depend on FastAPI Request objects and access application state (like database pools or configuration) that would normally only be available in HTTP handlers. The library works by injecting a worker-wide Request object at task startup, letting you reuse the same dependency functions across both FastAPI endpoints and taskiq tasks.
The package is designed for scenarios where you want to share business logic between synchronous HTTP handlers and asynchronous background tasks without duplicating dependency resolution. It requires explicit use of TaskiqDepends (rather than FastAPI's Depends) in task signatures so the taskiq resolver knows to inject dependencies. The documentation warns that the injected Request is a synthetic object created at worker startup, not tied to any actual HTTP request, and requires careful handling of broker startup/shutdown to avoid infinite recursion.
Use it for
- Share a database connection pool or Redis client between FastAPI endpoints and background tasks using the same dependency function.
- Inject application configuration or secrets into task functions without passing them as explicit parameters.
- Reuse FastAPI middleware-like logic (authentication, logging, tracing) in distributed task workers.
- Set up integration tests with InMemoryBroker by manually populating the dependency context for both FastAPI and taskiq.
- Build microservices where FastAPI handles HTTP requests and taskiq handles async work, both accessing the same application state.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are already using both FastAPI and taskiq and want to share dependency injection logic between them.
The low install friction, permissive license, and active maintenance make it a reasonable choice. Be aware it is classified as Alpha, so expect potential API changes. Verify that the synthetic Request object meets your dependency needs before committing to production use.
Install
taskiq-fastapi on PyPI
Before you install
Low install friction with only two runtime dependencies (taskiq and fastapi). Active maintenance as of 2026-04-18. Classified as Alpha, so expect API surface changes.
Requires Python 3.10 or later. Requires a running taskiq broker (e.g., ZeroMQ, Redis) and FastAPI application instance.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install taskiq-fastapi
import taskiq_fastapi
from taskiq import ZeroMQBroker
from fastapi import FastAPI
broker = ZeroMQBroker()
app = FastAPI()
taskiq_fastapi.init(broker, "myapp:app")
Verify before relying
- Whether the synthetic Request object created by init() is sufficient for all FastAPI dependency patterns in production workloads.
- Performance characteristics when dependency context is large or frequently updated.
- Compatibility with FastAPI versions beyond those tested during development.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagestaskiqfastapi |
| Maintenance | Actively maintained 118 days since the last release |
| First released | |
| Downloads | 225,315 / month, #9,222 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: System :: NetworkingTyping :: Typed |
Evidence: taskiq_fastapi-0.5.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “fastapi taskiq integration”
- taskiq-fastapiIntegrates FastAPI request and dependency injection into taskiq…
- taskiqTaskiq is an asynchronous distributed task queue that lets you send…
- taskiq-aio-pikaProvides a RabbitMQ broker implementation for taskiq, enabling…
Give your agent the search over MCP, or paste the wish link into any chat.
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
psutil retrieves real-time information about running processes and system resources (CPU, memory, disks, network, sensors) across multiple operating systems, enabling system monitoring, process profiling, and resource management.
pyOpenSSL wraps OpenSSL's SSL/TLS functionality for Python, providing high-level connection objects and certificate handling through a Python-friendly interface around OpenSSL's cryptographic operations.
uvloop is a drop-in replacement for Python's built-in asyncio event loop, implemented in Cython and using libuv, that accelerates async I/O operations.
execnet lets you spawn and communicate with Python interpreters across local processes, remote hosts, and different platforms, using a simple API for task distribution and inter-process messaging.
However, the aging maintenance status (275 days since last release) means you should verify it meets your concurrency and performance needs before committing to a…
PyZMQ provides Python bindings for ZeroMQ (ØMQ), a lightweight messaging library that enables fast, asynchronous communication between distributed processes and applications.
See also taskiq · taskiq-dependencies · taskiq-redis · taskiq-aio-pika · fast-depends · fastapi-injectable · fasta2a · codewords-client · fastapi-utilities · fastapi-decorators