Flask-Injector
Adds Injector, a Dependency Injection framework, support to Flask.
Decision gist · record as of 2026-08-14
Yes, with conditions. Flask-Injector is stable and well-suited for new Flask projects that prioritize testability and clean dependency management. However, the dormant maintenance status (last release 2023-07-27) means you should verify compatibility with your target Flask and Injector versions before committing. If your project requires active upstream support or frequent dependency updates, consider whether the risk of stale maintenance is acceptable. For established projects with fixed dependencies, it remains a solid choice.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Flask 2.2.0 or greater and Injector 0.20.0 or greater; compatible with CPython 3.7+.
- Low install friction with a pure-Python wheel distribution.
- Maintenance is dormant—last release was 2023-07-27, but the package is marked Production/Stable and has 282 repository stars.
License · maintenance · safety
BSD (permissive) — Licensed under BSD (permissive), which allows commercial and private use with minimal restrictions. No notable licensing constraints for typical adoption.
last release 2023-07-27 (1114 days) · last repo commit 2024-05-08 · 282 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 106,151 downloads/mo, #12,666 on PyPI
Alternatives
Verify before relying
pip install Flask-Injector
from flask import Flask
from flask_injector import FlaskInjector
from injector import inject
app = Flask(__name__)
@app.route('/example')
def example(some_dependency):
return 'Injected'
def configure(binder):
binder.bind(str, to='injected_value')
FlaskInjector(app=app, modules=[configure])
app.run()- Whether dormant maintenance (last commit 2024-05-08) poses compatibility risks with newer Flask or Injector versions.
- Real-world performance impact of dependency injection overhead in high-throughput Flask applications.
- Extent of community support or third-party maintenance if upstream development remains inactive.
What it is and what it does
Flask-Injector bridges the Injector dependency-injection framework into Flask applications. Instead of using Flask's global objects (like the global request context or extension singletons), you define dependencies in Injector modules and have them automatically injected into views, request handlers, template processors, and other Flask components. This eliminates the need for global state, making applications easier to test and reason about.
The package works by wrapping Flask's initialization and hooking into its request lifecycle. It binds Flask's core objects (the app, config, and request) into the Injector container at appropriate scopes (singleton for app and config, request-scoped for the current request), then resolves function parameters by type annotation. It integrates with Flask-RESTful, Flask-RestPlus, and Flask-RESTX resource constructors, and supports custom scopes for advanced use cases.
Use it for
- Build testable Flask applications by injecting mock dependencies instead of relying on global Flask objects during unit tests.
- Manage database connections, caches, or service clients as request-scoped or singleton dependencies without global initialization.
- Integrate Flask extensions through Injector modules instead of the typical global pattern.
- Implement class-based views with constructor injection to avoid accessing globals in __init__ methods.
- Decouple Flask route handlers from concrete implementations by injecting interfaces or abstract services.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Flask-Injector is stable and well-suited for new Flask projects that prioritize testability and clean dependency management. However, the dormant maintenance status (last release 2023-07-27) means you should verify compatibility with your target Flask and Injector versions before committing. If your project requires active upstream support or frequent dependency updates, consider whether the risk of stale maintenance is acceptable. For established projects with fixed dependencies, it remains a solid choice.
Install
flask-injector on PyPI
Before you install
Low install friction with a pure-Python wheel distribution. Maintenance is dormant—last release was 2023-07-27, but the package is marked Production/Stable and has 282 repository stars. Suitable for established projects that don't require active upstream development.
Requires Flask 2.2.0 or greater and Injector 0.20.0 or greater; compatible with CPython 3.7+.
License in practice
Licensed under BSD (permissive), which allows commercial and private use with minimal restrictions. No notable licensing constraints for typical adoption.
Quickstart
pip install Flask-Injector
from flask import Flask
from flask_injector import FlaskInjector
from injector import inject
app = Flask(__name__)
@app.route('/example')
def example(some_dependency):
return 'Injected'
def configure(binder):
binder.bind(str, to='injected_value')
FlaskInjector(app=app, modules=[configure])
app.run()
Verify before relying
- Whether dormant maintenance (last commit 2024-05-08) poses compatibility risks with newer Flask or Injector versions.
- Real-world performance impact of dependency injection overhead in high-throughput Flask applications.
- Extent of community support or third-party maintenance if upstream development remains inactive.
Package facts
| License | BSD permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesFlaskinjectortyping |
| Maintenance | Dormant 1,114 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 106,151 / month, #12,666 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 :: FlaskIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: LibrariesTopic :: Software Development :: TestingTopic :: Utilities |
Evidence: Flask_Injector-0.15.0-py2.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 › “flask dependency injection”
- Flask-InjectorIntegrates dependency injection into Flask applications using the…
- svcssvcs is a dependency container that registers factories for types and…
- fast-dependsFastDepends provides a standalone dependency injection system…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also injector · dependency-injector · fastapi-injector · inject · in-n-out · Flask-Caching · Flask-GraphQL · rodi · alluka · flask-cors