Durable jobs/events for Demystify: asyncio mirror of @demystify/events (enqueue, transactional outbox, idempotent workers, backoff+jitter, DLQ).
Project description
demystify-events
Durable jobs and events for Python — the asyncio mirror of the TypeScript @demystify/events runtime. Postgres-backed (pgmq) with a transactional outbox, idempotent consumers, exponential backoff + full jitter retries, and a dead-letter queue — with a full-fidelity in-memory driver so the same code runs offline with no database.
Part of the Demystify Core Services suite.
Install
pip install demystify-events
# real Postgres driver (psycopg + connection pool):
pip install "demystify-events[pg]"
Quickstart (offline, no database)
from demystify_events import create_events_client
from demystify_events.adapters.memory import MemoryQueueDriver
client = create_events_client(driver=MemoryQueueDriver())
# enqueue a job
await client.enqueue("email.send", {"to": "user@example.com"})
# process it (idempotent, retried with backoff+jitter, DLQ on poison)
async def handler(ctx, job):
... # do work; effects committed in the same transaction as the ack
await client.work("email.send", handler)
Switch to real Postgres by passing the psycopg driver (from the [pg] extra)
with a database_url — the handler contract is identical.
What's in the box
create_events_client/EventsClient— enqueue, transactionalenqueue_in_tx, workerscontract_backoff,full_jitter_backoff,BackoffConfig— retry schedulesContractRegistry— JSON-schema event-type validationmake_envelope/validate_envelope— canonical event envelopes- Adapters:
MemoryQueueDriver(offline) andpsycopg(Postgres/pgmq)
The published wheel is self-contained — it does not vendor
demystify-platform-contracts; contract convergence is asserted by the test
suite. See the module README
for the delivery guarantees, chaos-test results, and the /ops/v1 API.
License
MIT © Demystify Systems
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 demystify_events-0.2.0.tar.gz.
File metadata
- Download URL: demystify_events-0.2.0.tar.gz
- Upload date:
- Size: 109.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cdbfb0cba33b5dbd18d7339307fa2878f7ef3d3532a98a55162b3d68e30f0c9
|
|
| MD5 |
659b8a09ee88d3b6ba65d9e27f2519c9
|
|
| BLAKE2b-256 |
0dabd9893c52ecc8e58f3e502cf74c15b354a92b0b173b89d63080fb954af93a
|
Provenance
The following attestation bundles were made for demystify_events-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on demystify-systems/ai-services-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
demystify_events-0.2.0.tar.gz -
Subject digest:
0cdbfb0cba33b5dbd18d7339307fa2878f7ef3d3532a98a55162b3d68e30f0c9 - Sigstore transparency entry: 2171521494
- Sigstore integration time:
-
Permalink:
demystify-systems/ai-services-tools@4dc06acee6676d683f961e82b0fd16cd7d433d27 -
Branch / Tag:
refs/heads/claude/six-services-modular-build-h0faac - Owner: https://github.com/demystify-systems
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@4dc06acee6676d683f961e82b0fd16cd7d433d27 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file demystify_events-0.2.0-py3-none-any.whl.
File metadata
- Download URL: demystify_events-0.2.0-py3-none-any.whl
- Upload date:
- Size: 39.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
488ddc7ae32e5e3a1ccc7a3bcdea4ce095f6bf40a1948c187b918d80ecf50f91
|
|
| MD5 |
f5f591c3eee9b50c532ac85e3690ba72
|
|
| BLAKE2b-256 |
82d00c6ec2692ab23dee712e66b005b80d08244bafcdaa666d005bb940c29656
|
Provenance
The following attestation bundles were made for demystify_events-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on demystify-systems/ai-services-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
demystify_events-0.2.0-py3-none-any.whl -
Subject digest:
488ddc7ae32e5e3a1ccc7a3bcdea4ce095f6bf40a1948c187b918d80ecf50f91 - Sigstore transparency entry: 2171521502
- Sigstore integration time:
-
Permalink:
demystify-systems/ai-services-tools@4dc06acee6676d683f961e82b0fd16cd7d433d27 -
Branch / Tag:
refs/heads/claude/six-services-modular-build-h0faac - Owner: https://github.com/demystify-systems
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@4dc06acee6676d683f961e82b0fd16cd7d433d27 -
Trigger Event:
workflow_dispatch
-
Statement type: