svcs
A Flexible Service Locator
Decision gist · record as of 2026-08-14
Yes. svcs is actively maintained, production-stable, has no known vulnerabilities, and solves a genuine problem in dependency management for Python web applications. The low install friction and optional static typing make it accessible. It's particularly valuable if you're using FastAPI, Flask, or another supported framework and want to reduce boilerplate around service acquisition and cleanup.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; Python 3.9 support was removed.
- Low friction install with only two lightweight runtime dependencies (attrs and typing-extensions).
- Active maintenance with a release 32 days ago and recent commits; marked Production/Stable.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
last release 2026-07-13 (32 days) · last repo commit 2026-08-05 · 422 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 7,427,821 downloads/mo, #1,741 on PyPI
Alternatives
Verify before relying
pip install svcs
from svcs import Container
from attrs import define
@define
class Database:
pass
container = Container()
container.register(Database, factory=Database)
db = container.get(Database)- Whether the framework integrations (AIOHTTP, FastAPI, Flask, Pyramid, Starlette) are included in the base package or require separate installation.
- Performance characteristics when managing large numbers of service instances or complex dependency graphs.
- Whether health checks are automatically invoked or must be explicitly called.
What it is and what it does
svcs is a dependency container that centralizes the registration and acquisition of service instances in Python applications. It supports both dependency injection and service locator patterns without requiring global state, decorators, or function signature changes. The container automatically manages cleanup of acquired services through context managers and provides health checks for monitoring.
The package integrates with popular web frameworks (AIOHTTP, FastAPI, Flask, Pyramid, Starlette) and provides full static type safety when used with a type checker. It reduces boilerplate code for service acquisition and cleanup while maintaining loose coupling between components, which simplifies testing. Recent versions added support for abstract types via PEP 747 and autowiring based on type annotations.
Use it for
- Manage database connections, API clients, and caches in FastAPI or Flask applications with automatic cleanup per request.
- Implement dependency injection in web frameworks without decorators or global state, improving testability.
- Register multiple implementations of a service interface and switch between them for different environments or test scenarios.
- Add health checks to services for monitoring and observability in production applications.
- Automatically resolve and inject dependencies based on type annotations in function signatures.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
svcs is actively maintained, production-stable, has no known vulnerabilities, and solves a genuine problem in dependency management for Python web applications. The low install friction and optional static typing make it accessible. It's particularly valuable if you're using FastAPI, Flask, or another supported framework and want to reduce boilerplate around service acquisition and cleanup.
Install
svcs on PyPI
Before you install
Low friction install with only two lightweight runtime dependencies (attrs and typing-extensions). Active maintenance with a release 32 days ago and recent commits; marked Production/Stable.
Requires Python 3.10 or later; Python 3.9 support was removed.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install svcs
from svcs import Container
from attrs import define
@define
class Database:
pass
container = Container()
container.register(Database, factory=Database)
db = container.get(Database)
Verify before relying
- Whether the framework integrations (AIOHTTP, FastAPI, Flask, Pyramid, Starlette) are included in the base package or require separate installation.
- Performance characteristics when managing large numbers of service instances or complex dependency graphs.
- Whether health checks are automatically invoked or must be explicitly called.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesattrstyping-extensions |
| Maintenance | Actively maintained 32 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 7,427,821 / month, #1,741 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/StableProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Typing :: Typed |
Evidence: svcs-26.1.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 › “service locator python”
- svcssvcs is a dependency container that registers factories for types and…
- slackA dependency injection container that registers and provides…
- injectProvides a lightweight dependency injection framework for Python that…
Give your agent the search over MCP, or paste the wish link into any chat.
More Application Frameworks packages
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.
Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.
Install it if you're developing CLI tools, dashboards, or interactive terminal applications.
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.
Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.
Install it if you need to build or connect to servers.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
See also dependencies · kink · dependency-injector · wireup · slack · simple-di · punq · injector · inject · rodi