Use FastAPI's Depends() anywhere — in CLI tools, Celery tasks, background workers, and more. No refactoring needed. Current version: 1.4.7. Python >=3.10. Active development.
pip install fastapi-injectableNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Inject FastAPI-style dependencies anywhere, even outside an async context.
Replace get_injected_obj with async_get_injected_obj when in an async context.
Use from fastapi_injectable import get_injected_obj.
Let fastapi-injectable handle stack management; avoid overriding internal AsyncExitStack.
Use the override parameter of get_injected_obj or ensure app.dependency_overrides is applied before calling.
Use async_get_injected_obj() instead: from fastapi_injectable import async_get_injected_obj; result = await async_get_injected_obj(func)
Use: from fastapi_injectable import get_injected_obj
Use Annotated[type, Depends(dependency)] syntax, e.g., DepDB = Annotated[str, Depends(get_db)]
Ensure the app parameter is not None when using overrides, or omit it.
No dependency data recorded yet.