kink
Dependency injection for python.
Decision gist · record as of 2026-08-14
Yes. Kink is a solid choice for Python projects that want dependency injection without heavyweight frameworks. It has low install friction, active maintenance, no known vulnerabilities, a permissive MIT license, and broad Python version support. Use it when you want to decouple components and improve testability without adopting a full web framework.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Installation is straightforward with low friction—a pure Python wheel with only typing_extensions as a runtime dependency.
- The project is actively maintained with a recent release on 2026-03-19 and shows healthy repository signals.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
last release 2026-03-19 (148 days) · last repo commit 2026-03-19 · 444 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 132,726 downloads/mo, #11,539 on PyPI
Alternatives
Verify before relying
pip install kink
from kink import di, inject
from typing_extensions import Annotated
di["config"] = {"db": "test.db"}
di["db_connection"] = lambda di: f"Connection to {di['config']['db']}"
@inject
class UserService:
def __init__(self, db_connection: str):
self.db = db_connection
service = di[UserService]
print(service.db)- Whether async/await support works with all Python versions listed (3.8–3.14) or has version-specific limitations
- Performance characteristics when managing large numbers of services or deeply nested dependency graphs
- How custom dependency resolvers integrate with the autowiring mechanism in practice
What it is and what it does
Kink is a dependency injection container that manages object creation and dependency resolution for Python applications. It allows you to register services (either eagerly or on-demand) in a central container and then automatically inject them into classes and functions via the @inject decorator. The container supports both name-based and type-annotation-based dependency matching, with a clear priority system: manually passed arguments override name matches, which override type annotations.
The package solves the problem of tightly coupled code by letting you define dependencies externally rather than hardcoding them. It supports factories (services created fresh on each request), lazy initialization via lambdas, and async operations. With only typing_extensions as a dependency, it integrates cleanly into modern Python projects supporting versions 3.8 through 3.14.
Use it for
- Bootstrap configuration and database connections at startup, then inject them throughout your application without passing through signatures.
- Build testable class hierarchies by injecting mock implementations in tests while using real implementations in production.
- Create plugin or factory patterns where the container automatically instantiates the correct implementation based on type annotations.
- Manage async service initialization and lifecycle in asyncio-based applications without manual state management.
- Reduce boilerplate in multi-layer applications by letting the container wire dependencies automatically.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Kink is a solid choice for Python projects that want dependency injection without heavyweight frameworks. It has low install friction, active maintenance, no known vulnerabilities, a permissive MIT license, and broad Python version support. Use it when you want to decouple components and improve testability without adopting a full web framework.
Install
kink on PyPI
Before you install
Installation is straightforward with low friction—a pure Python wheel with only typing_extensions as a runtime dependency. The project is actively maintained with a recent release on 2026-03-19 and shows healthy repository signals.
License in practice
MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install kink
from kink import di, inject
from typing_extensions import Annotated
di["config"] = {"db": "test.db"}
di["db_connection"] = lambda di: f"Connection to {di['config']['db']}"
@inject
class UserService:
def __init__(self, db_connection: str):
self.db = db_connection
service = di[UserService]
print(service.db)
Verify before relying
- Whether async/await support works with all Python versions listed (3.8–3.14) or has version-specific limitations
- Performance characteristics when managing large numbers of services or deeply nested dependency graphs
- How custom dependency resolvers integrate with the autowiring mechanism in practice
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0,>=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetyping_extensions |
| Maintenance | Actively maintained 148 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 132,726 / month, #11,539 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules |
Evidence: kink-0.9.0-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 › “autowiring dependency resolver”
- kinkKink is a lightweight dependency injection container for Python that…
- resolvelibResolveLib provides a generic dependency resolver that takes abstract…
- nab-resolverA generic PubGrub-style dependency resolver core that accepts a…
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 · dishka · simple-di · slack · lagom · punq · alluka · dependency-injector · dependencies · wireup