fast-depends
FastDepends - extracted and cleared from HTTP domain logic FastAPI Dependency Injection System. Async and sync are both supported.
Decision gist · record as of 2026-08-14
Yes. FastDepends is actively maintained, has no known vulnerabilities, minimal dependencies, and solves a real problem—bringing FastAPI's clean DI patterns to non-web code. It's worth installing if you want structured dependency injection with type validation in sync or async code outside a web framework, or as a building block for custom frameworks.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction installation with just two runtime dependencies (anyio and typing-extensions).
- The package is actively maintained with a recent release and no known vulnerabilities.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal attribution requirements.
last release 2026-03-02 (165 days) · last repo commit 2026-08-13 · 517 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,039,686 downloads/mo, #3,348 on PyPI
Alternatives
Verify before relying
pip install fast-depends
from fast_depends import inject, Depends
def dependency(a: int) -> int:
return a
@inject
def main(a: int, b: int, c: int = Depends(dependency)) -> float:
return a + b + c
assert main("1", 2) == 4.0- Whether custom field extensibility is sufficient for complex framework-building use cases beyond the documented Header example.
- Performance characteristics compared to native FastAPI dependency injection or other standalone DI libraries.
What it is and what it does
FastDepends is a lightweight dependency injection container extracted from FastAPI's internals, stripped of HTTP-specific logic to work as a standalone library. It lets you decorate functions with @inject to automatically resolve dependencies, cast arguments to their annotated types, and validate inputs using pydantic—all without requiring a web framework. Both synchronous and asynchronous functions are supported equally, and return values are also cast according to type annotations.
The library is designed to bring FastAPI's familiar DI patterns into non-web applications, legacy frameworks like Flask, or as a foundation for building custom frameworks. It includes a dependency override system for testing and a custom field mechanism for extending behavior, making it useful for message queues, CLI tools, and other contexts where you want structured dependency resolution without HTTP overhead.
Use it for
- Add FastAPI-style dependency injection to Flask or other non-async frameworks for cleaner parameter handling.
- Build CLI tools or background job runners that need type validation and dependency resolution without a web server.
- Create a custom framework or message queue handler (like Propan or FastStream) with built-in DI support.
- Write testable async code with easy dependency mocking via the dependency override system.
- Validate and cast function arguments automatically using pydantic without writing custom decorators.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
FastDepends is actively maintained, has no known vulnerabilities, minimal dependencies, and solves a real problem—bringing FastAPI's clean DI patterns to non-web code. It's worth installing if you want structured dependency injection with type validation in sync or async code outside a web framework, or as a building block for custom frameworks.
Install
fast-depends on PyPI
Before you install
Low friction installation with just two runtime dependencies (anyio and typing-extensions). The package is actively maintained with a recent release and no known vulnerabilities.
Requires Python 3.10 or later.
License in practice
MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal attribution requirements.
Quickstart
pip install fast-depends
from fast_depends import inject, Depends
def dependency(a: int) -> int:
return a
@inject
def main(a: int, b: int, c: int = Depends(dependency)) -> float:
return a + b + c
assert main("1", 2) == 4.0
Verify before relying
- Whether custom field extensibility is sufficient for complex framework-building use cases beyond the documented Header example.
- Performance characteristics compared to native FastAPI dependency injection or other standalone DI libraries.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesanyiotyping-extensions |
| Maintenance | Actively maintained 165 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,039,686 / month, #3,348 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: PydanticFramework :: Pydantic :: 1Framework :: Pydantic :: 2Intended Audience :: DevelopersIntended Audience :: Information TechnologyLicense :: OSI Approved :: MIT LicenseOperating 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.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: fast_depends-3.0.8-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 di without http”
- fast-dependsFastDepends provides a standalone dependency injection system…
- wireupWireup is a type-driven dependency injection container for Python…
- taskiq-dependenciesProvides FastAPI-style dependency injection for Python projects,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also fastapi-decorators · fastapi-injectable · taskiq-dependencies · simple-di · dependency-injector · in-n-out · fastapi-injector · fastapi-sessions · cadwyn · taskiq-fastapi