Async dependency injection for Python functions
Project description
uncalled-for
Async dependency injection for Python functions.
Declare what your function needs as parameter defaults. They show up resolved when the function runs. No ceremony, no container, no configuration.
from uncalled_for import Depends
async def get_db():
db = await connect()
try:
yield db
finally:
await db.close()
async def handle_request(db: Connection = Depends(get_db)):
await db.execute("SELECT 1")
Features
- Zero dependencies — standard library only
- Async-native — built on
AsyncExitStackandContextVar - Context manager lifecycle — sync and async generators get proper cleanup
- Nested dependencies — dependencies can depend on other dependencies
- Caching — each dependency resolves once per call, even if referenced multiple times
Install
pip install uncalled-for
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uncalled_for-0.3.0.tar.gz.
File metadata
- Download URL: uncalled_for-0.3.0.tar.gz
- Upload date:
- Size: 52.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a2fffa03ccf92d2442084358a001ab06b4ca90aedcd93cc2f33e5b12054851b
|
|
| MD5 |
dca596133983c0d8b17b06708d8c0c84
|
|
| BLAKE2b-256 |
b3982acd616882f04f57199ca1eaf818542e7e6f09f0df2ad6d53889cf46d3d1
|
Provenance
The following attestation bundles were made for uncalled_for-0.3.0.tar.gz:
Publisher:
publish.yml on chrisguidry/uncalled-for
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uncalled_for-0.3.0.tar.gz -
Subject digest:
3a2fffa03ccf92d2442084358a001ab06b4ca90aedcd93cc2f33e5b12054851b - Sigstore transparency entry: 1244544097
- Sigstore integration time:
-
Permalink:
chrisguidry/uncalled-for@6e38aa3247fcf889461e106f85bcc7d89351d702 -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/chrisguidry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6e38aa3247fcf889461e106f85bcc7d89351d702 -
Trigger Event:
release
-
Statement type:
File details
Details for the file uncalled_for-0.3.0-py3-none-any.whl.
File metadata
- Download URL: uncalled_for-0.3.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d39d98c64e740e0c0c2ead9c92e7a64e1aef0a407df5ac88318931d023ccb512
|
|
| MD5 |
f9e51804233769afdb03fe64272585cb
|
|
| BLAKE2b-256 |
72c9a1868434ffbe896e02c6fe4718d1bb34140a0269632c923c8e6e34ba2a44
|
Provenance
The following attestation bundles were made for uncalled_for-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on chrisguidry/uncalled-for
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uncalled_for-0.3.0-py3-none-any.whl -
Subject digest:
d39d98c64e740e0c0c2ead9c92e7a64e1aef0a407df5ac88318931d023ccb512 - Sigstore transparency entry: 1244544099
- Sigstore integration time:
-
Permalink:
chrisguidry/uncalled-for@6e38aa3247fcf889461e106f85bcc7d89351d702 -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/chrisguidry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6e38aa3247fcf889461e106f85bcc7d89351d702 -
Trigger Event:
release
-
Statement type: