Jobify integration for Dishka
Though it is not required, you can use dishka-jobify integration. It features:
- REQUEST scope management using jobify request scope
- JobifyProvider for working with
JobContext,Job,State,RequestState,Runnablein container
You need to specify @inject manually.
Installation
Install using pip
pip install dishka-jobify
Or with uv
uv add dishka-jobify
How to use
- Import
from dishka_jobify import (
FromDishka,
inject,
setup_dishka
)
from dishka import make_async_container, Provider, provide, Scope
- Create provider like here below
class MyProvider(Provider):
@provide(scope=Scope.REQUEST)
def get_greeting_service(self) -> GreetingService:
return GreetingService(name="Dishka User")
@provide(scope=Scope.APP)
def get_counter_service(self) -> CounterService:
return CounterService()
- Mark those of your handlers parameters which are to be injected with
FromDishka[]
@app.task
@inject
async def my_cron(
greeting: FromDishka[GreetingService],
counter: FromDishka[CounterService],
) -> None:
count = counter.increment()
print(f"[cron] {greeting.greet('cron')} count={count}")
- Setup
dishkaintegration.
UTC = ZoneInfo("UTC")
app = Jobify(tz=UTC)
provider = MyProvider()
container = make_async_container(provider, JobifyProvider())
setup_dishka(container=container, app=app)
Metadata
Release files for dishka-jobify 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dishka_jobify-0.0.1.tar.gz | 122.5 kB | Without provenance | Details for dishka_jobify-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dishka_jobify-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for dishka_jobify-0.0.1-py3-none-any.whl |
Total release size: 132.6 kB
Release files / dishka_jobify-0.0.1.tar.gz
| Download URL | dishka_jobify-0.0.1.tar.gz |
|---|---|
| Size | 122.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0cebcc19f5fe0dff602875dcd1a80444eabf43bb59d48334f49f822db9fac9ec
|
|
BLAKE2b-256 checksum How to use checksums |
20d08a6d7d18ccd7cb7ce7b9f58622103aee6778aa31cef939f942395815799c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / dishka_jobify-0.0.1-py3-none-any.whl
| Download URL | dishka_jobify-0.0.1-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
01ff29c7061128be24d331b1a15dc798cc1262a5caa52a5d5311c12b4dfcce4c
|
|
BLAKE2b-256 checksum How to use checksums |
c3c0ac6cb4de9e5a1296a4254f76d87f50e134a4e0177a67c31eed6f0e85e89f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for dishka-jobify 0.0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.