svcs Integration for Pyramid.
svcs-pyramid is the svcs integration for Pyramid.
svcs (pronounced services) is a dependency container for Python. It gives you a central place to register factories for types/interfaces and then imperatively acquire instances of those types with automatic cleanup and health checks.
svcs-pyramid wires that up for Pyramid: it stores the svcs registry in Pyramid's own registry (yes, unfortunate name clash) and uses a tween to attach a fresh container to every request – and to close it when the request is done.
import svcs_pyramid
def make_app():
with Configurator(settings=settings) as config:
svcs_pyramid.init(config)
svcs_pyramid.register_factory(config, Database, db_factory)
return config.make_wsgi_app()
@view_config(route_name="index")
def view(request):
db, api, cache = svcs_pyramid.get(request, Database, WebAPIClient, Cache)
To a type checker, db has the type Database, api has the type WebAPIClient, and cache has the type Cache.
db, api, and cache will be automatically cleaned up when the request ends – it's context managers all the way down.
Read on in svcs's Why? if you're intrigued.
Project links
Release Information
Deprecated
svcs_pyramid.get_abstract()is carried over fromsvcs.pyramidso that the rename is the only change you have to make, but it's deprecated. Thanks to PEP 747,svcs_pyramid.get()does the same thing. There are no deprecation warnings or plans to remove it for now.
Added
- Initial release.
svcs-pyramid is the extraction of svcs's
svcs.pyramidmodule into its own package.
Changed
-
The import name is
svcs_pyramidinstead ofsvcs.pyramid. Nothing else changed, so migrating is a pure rename:import svcs → import svcs_pyramid svcs.pyramid.init(…) → svcs_pyramid.init(…)The registry and the container are still stored under the
svcs_registryandsvcs_containerkeys, sosvcs_pyramidis a drop-in replacement forsvcs.pyramid.
Credits
svcs-pyramid is written by Hynek Schlawack and distributed under the terms of the MIT license.
It started out as the svcs.pyramid module inside of svcs and has been extracted into its own package.
The development is kindly supported by my employer Variomedia AG and all my fabulous GitHub Sponsors.
The Bestagon radar logo is made by Lynn Root, based on a Font Awesome icon.
Metadata
Release files for svcs-pyramid 26.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| svcs_pyramid-26.1.0.tar.gz | 148.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| svcs_pyramid-26.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 154.8 kB
Release files / svcs_pyramid-26.1.0.tar.gz
| Download URL | svcs_pyramid-26.1.0.tar.gz |
|---|---|
| Size | 148.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
931c87cf8231fccbc4e828fd13adcd4b00a71b9d0f1a3dc43f11d2a762ffcada
|
|
BLAKE2b-256 checksum How to use checksums |
bb2bf86d51b3a0c4de8093633c3d3bdea16076209f90afd48306c0add4ec9b5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.
Transparency logRelease files / svcs_pyramid-26.1.0-py3-none-any.whl
| Download URL | svcs_pyramid-26.1.0-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80b8c29624bd59967accedec1e837c83c481afcfb7e459ca78560b662ffce086
|
|
BLAKE2b-256 checksum How to use checksums |
b29c04d086e169f59b6cdb5c76f725868dfe0dca2f74a5828fb4d36a8654fff9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.
Transparency log