Prereq is a dependency injection library for Python that is uncomplicated, and async-first.
Project description
Prereq
Prereq is a dependency injection library for Python that is uncomplicated, and async-first.
Full Documentation Here
Installation
Use your favorite package manager to install prereq.
pip install prereq
# Or
uv add prereq
Usage
To get started with Prereq, you just need to create a Provider, and a Resolver. Behavior is inferred based on typing.
import asyncio
from prereq import provides, Resolver
class User: ...
@provides
def user_factory() -> User:
return User()
def update_user(user: User) -> None:
print(f"Updated {user}")
resolver = Resolver()
resolver.add_providers(user_factory)
async def main() -> None:
async with resolver.resolve(update_user) as kwargs:
update_user(**kwargs)
asyncio.run(main())
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Pull requests must pass ruff, and avoid ignoring pyright errors (but it may be needed, I understand.). You may need to add tests to maintain Prereq's 100% coverage.
License
Prepreq is free and open source using the MIT license.
Project details
Release history Release notifications | RSS feed
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 prereq-0.1.0b0.tar.gz.
File metadata
- Download URL: prereq-0.1.0b0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86dae26e8e72fe0b5a4db8d96c98709d7f75bdbcef7ae93107a7c7d55bc6a7aa
|
|
| MD5 |
ec9cf46984903e7cd1e2790d968be9f6
|
|
| BLAKE2b-256 |
799723f821ab612cbd0373c78e72b8f8ed75857155b0b3006295dfd132d8b212
|
Provenance
The following attestation bundles were made for prereq-0.1.0b0.tar.gz:
Publisher:
ci-cd.yaml on Zwork101/prereq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prereq-0.1.0b0.tar.gz -
Subject digest:
86dae26e8e72fe0b5a4db8d96c98709d7f75bdbcef7ae93107a7c7d55bc6a7aa - Sigstore transparency entry: 788761218
- Sigstore integration time:
-
Permalink:
Zwork101/prereq@7a7490030c248352f42782a9a9cc29a672050c22 -
Branch / Tag:
refs/tags/v0.1.0b-real - Owner: https://github.com/Zwork101
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yaml@7a7490030c248352f42782a9a9cc29a672050c22 -
Trigger Event:
push
-
Statement type:
File details
Details for the file prereq-0.1.0b0-py3-none-any.whl.
File metadata
- Download URL: prereq-0.1.0b0-py3-none-any.whl
- Upload date:
- Size: 9.0 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 |
ba122762a37b9853aac9205882d1215162390c82a9ff90c436bcabba0d128206
|
|
| MD5 |
9865180cd93652f376cda15a0bba1f94
|
|
| BLAKE2b-256 |
5da767ff9a92d457445297ba96371c6adf3af3d0ba0a691c1666828995772f40
|
Provenance
The following attestation bundles were made for prereq-0.1.0b0-py3-none-any.whl:
Publisher:
ci-cd.yaml on Zwork101/prereq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prereq-0.1.0b0-py3-none-any.whl -
Subject digest:
ba122762a37b9853aac9205882d1215162390c82a9ff90c436bcabba0d128206 - Sigstore transparency entry: 788761222
- Sigstore integration time:
-
Permalink:
Zwork101/prereq@7a7490030c248352f42782a9a9cc29a672050c22 -
Branch / Tag:
refs/tags/v0.1.0b-real - Owner: https://github.com/Zwork101
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yaml@7a7490030c248352f42782a9a9cc29a672050c22 -
Trigger Event:
push
-
Statement type: