Registry / web-framework / dapr-ext-fastapi

dapr-ext-fastapi

JSON →
library1.18.0pypypi✓ verified 85d ago

The Dapr FastAPI extension integrates Dapr's pub/sub, actors, and bindings with FastAPI applications. Version 1.17.4 supports Python >=3.10, released on 2025-09-12. Release cadence is approximately monthly.

pip install dapr-ext-fastapi
INSTALL
IMPORT
SIG · DAPR-EXT-FASTAPI
D
dapr-ext-fastapi
web-frameworkpythonv1.18.0
Install
8.3s avg
Import
2449ms
Disk
68MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.18.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 2.936s · 68.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 8.3s · import 1.962s · 67MB
68MB installed
● package 68MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DaprApp
from dapr.ext.fastapi import DaprApp
from dapr.fastapi import DaprApp
Old import path changed in dapr-ext-fastapi v1.0

Minimal FastAPI app with Dapr extension

from fastapi import FastAPI from dapr.ext.fastapi import DaprApp app = FastAPI() dapr_app = DaprApp(app) @app.get('/') def read_root(): return {'message': 'Hello Dapr'}
Debug
Known issues
breakingIn v1.3.0, the subscription decorator changed from @dapr_app.subscribe to @app.post with DaprPubSubMiddleware. Old decorator no longer works.
fix
Use FastAPI routes with DaprPubSubMiddleware for pub/sub.
affects: >=1.3.0
deprecateddapr_app.init() is deprecated in favor of initializing DaprApp with the FastAPI app directly.
fix
Use DaprApp(app) instead of DaprApp() and then dapr_app.init(app).
affects: >=1.4.0
gotchaWhen using Dapr actors, ensure the actor class is registered with @actor decorator and dapr_app.register_actor is called. Missing registration results in 'Actor not found' errors.
fix
Call dapr_app.register_actor(MyActor) after actor definition.
affects: all
Errors
Common errors & fixes
dapr.exceptions.DaprInternalError: Actor not found
Actor class not registered with DaprApp.
fix
Add dapr_app.register_actor(YourActorClass) after actor definition.
ImportError: cannot import name 'DaprApp' from 'dapr.fastapi'
Incorrect import path; the module is dapr.ext.fastapi.
fix
Use from dapr.ext.fastapi import DaprApp
RuntimeError: DaprApp has already been initialized
Calling dapr_app.init() or re-initializing with a second FastAPI app.
fix
Only pass the FastAPI app once in the constructor: DaprApp(app).
Upgrade
Version history
1.18.0latest on PyPI · released Jun 10, 2026
Audit
Dependencies
daprrequiredCore Dapr SDK required
fastapirequiredWeb framework dependency
Agent activity
26 hits · last 30 days
node
20
Amazon
2
OpenAI (training)
1
Resources
dapr-ext-fastapi — pip install dapr-ext-fastapi · libregistry