{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/6"}],"enrichment":{"capability":"Provides a lightweight dependency injection framework for Python that automatically injects dependencies into functions and classes using type annotations or explicit binding declarations.","skillfed_tags":["dependency-injection","inversion-of-control","testing"],"use_cases":["Decouple service implementations from their consumers in web frameworks or CLI applications by binding interfaces to concrete implementations.","Simplify test setup by configuring mock dependencies without modifying production code or class constructors.","Manage shared resources like database connections or caches across an application by binding them once and injecting where needed.","Build modular applications where different environments (dev, test, production) use different implementations of the same interface.","Reduce boilerplate in class hierarchies by using inject.attr to declare dependencies as class properties instead of constructor parameters."],"what_it_does":"Inject is a dependency injection framework that decouples object creation from usage by automatically wiring dependencies into functions and classes. It uses type annotations or explicit binding declarations to resolve and inject dependencies at runtime. The framework does not intercept or modify class constructors, instead offering decorators like @autoparams and @params, instance attributes via inject.attr, and direct instance retrieval via inject.instance.\n\nThe package supports multiple binding strategies: instance bindings (always return the same object), constructor bindings (create singletons on first injection), and provider bindings (call a function on each injection). It integrates transparently with tests through configuration clearing, handles context managers, and is thread-safe after initial configuration. Runtime binding can be disabled to catch unbound dependencies early.","worth_installing":"Yes. Inject is a mature, actively maintained dependency injection framework with no external dependencies, permissive licensing, and no known vulnerabilities. It is well-suited for Python projects that need lightweight, non-invasive dependency management. Install it if you want a simple alternative to heavier frameworks; skip it if your project already uses a framework with built-in DI (Django, FastAPI) or if you prefer explicit parameter passing."},"id":"inject","links":{"html":"https://skillfed.io/packages/inject","md":"https://skillfed.io/packages/inject.md","pypi":"https://pypi.org/project/inject/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-07-13","license_spdx":"Apache-2.0","license_treatment":"permissive","name":"inject","python_support":"supports_current","summary":"Python dependency injection framework."},"popularity":{"monthly_downloads":2322011,"position":3141,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"5.5.0"}
