Transactional outbox + delivery for Apso services (SQLAlchemy / FastAPI).
Project description
apso-domain-events (Python)
Transactional outbox + delivery for Apso services, built on SQLAlchemy 2.0
with an optional FastAPI integration. Implements the cross-language
CONTRACT.md.
state change ─(same DB txn)→ DomainEvent row (capture)
│
relay drains pending rows (poller)
│
fan out to active destination(s) (delivery)
Install
pip install apso-domain-events # webhook delivery needs no extra dep
pip install apso-domain-events[kafka] # confluent-kafka
pip install apso-domain-events[aws] # boto3 (sqs / eventbridge)
pip install apso-domain-events[fastapi] # FastAPI integration
Wire it
from apso_domain_events import register_domain_events
from myapp.models import Product, Order # the CLI-emitted manifest
register_domain_events(
engine, # Engine or sessionmaker
entities=[Product, Order], # only these emit; never hardcoded in the lib
poll_interval=5.0,
app=app, # optional FastAPI app → startup/shutdown poller
)
Create the events table from Base.metadata (or your migration tool):
from apso_domain_events import Base
Base.metadata.create_all(engine)
Delivery
The active destination(s) are chosen at runtime from EVENTS_DESTINATION
(comma-separated → fan-out):
| name | env | dependency |
|---|---|---|
webhook |
EVENTS_WEBHOOK_URL, EVENTS_WEBHOOK_SECRET |
none (stdlib HTTP + crypto) |
kafka |
EVENTS_KAFKA_BROKERS, EVENTS_KAFKA_TOPIC |
[kafka] |
sqs |
AWS_REGION, EVENTS_SQS_QUEUE_URL |
[aws] |
eventbridge |
AWS_REGION, EVENTS_EVENTBRIDGE_BUS |
[aws] |
At-least-once: fan-out re-sends to ALL destinations on retry. Consumers MUST dedupe on
event.id.
The webhook adapter signs requests per
Standard Webhooks (webhook-id,
webhook-timestamp, webhook-signature: v1,...).
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 apso_domain_events-0.1.0.tar.gz.
File metadata
- Download URL: apso_domain_events-0.1.0.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e91081c5c98bbdcafd8ec9fa96df24dd05db4bec98aa4a464fb22efb3cd5eba5
|
|
| MD5 |
7c0dc07af7e1d8f1d6e3805f60418e75
|
|
| BLAKE2b-256 |
05b33f9aeb002b355ae96dd212eaec8a170644fa540700bf4adc7f240e859154
|
Provenance
The following attestation bundles were made for apso_domain_events-0.1.0.tar.gz:
Publisher:
auto-release.yml on apsoai/apso-packages
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apso_domain_events-0.1.0.tar.gz -
Subject digest:
e91081c5c98bbdcafd8ec9fa96df24dd05db4bec98aa4a464fb22efb3cd5eba5 - Sigstore transparency entry: 1819598151
- Sigstore integration time:
-
Permalink:
apsoai/apso-packages@7c97f70ce84ab17d56b49595d073ecf9bfada30b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/apsoai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
auto-release.yml@7c97f70ce84ab17d56b49595d073ecf9bfada30b -
Trigger Event:
push
-
Statement type:
File details
Details for the file apso_domain_events-0.1.0-py3-none-any.whl.
File metadata
- Download URL: apso_domain_events-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.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 |
beac5b4502a9b5329de9d7b9128eda3fae1fcb32aff9fc1f7131ee2eba0bf169
|
|
| MD5 |
bb6a8a5a1049140bdbcff996a1d50847
|
|
| BLAKE2b-256 |
8f72ba9d23c016ae88d0a407dc6efebc5d91071dff8c1a3a9e401f86e1d56eea
|
Provenance
The following attestation bundles were made for apso_domain_events-0.1.0-py3-none-any.whl:
Publisher:
auto-release.yml on apsoai/apso-packages
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apso_domain_events-0.1.0-py3-none-any.whl -
Subject digest:
beac5b4502a9b5329de9d7b9128eda3fae1fcb32aff9fc1f7131ee2eba0bf169 - Sigstore transparency entry: 1819598190
- Sigstore integration time:
-
Permalink:
apsoai/apso-packages@7c97f70ce84ab17d56b49595d073ecf9bfada30b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/apsoai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
auto-release.yml@7c97f70ce84ab17d56b49595d073ecf9bfada30b -
Trigger Event:
push
-
Statement type: