eventsender
This is a simple event sender that publishes JSON-serialisable messages to an AMQP server exchange. It can also be optionally installed as a Django application.
Installation and configuration
The following settings should be supplied either as environment variables or via Django settings module:
EVENT_QUEUE_URL = os.environ.get('EVENT_QUEUE_URL')
EVENT_QUEUE_EXCHANGE = os.environ.get('EVENT_QUEUE_EXCHANGE')
EVENT_QUEUE_ROUTING_KEY = os.environ.get('EVENT_QUEUE_ROUTING_KEY', '')
EVENT_QUEUE_ROUTING_KEY is optional and can be omitted (it will be assumed blank by default).
Usage
Example:
from eventsender import send_event
send_event({'type': 'user.subscribed', 'username': 'john_doe'})
Or
EVENT_QUEUE_EXCHANGE=some_exchange EVENT_QUEUE_URL=amqp://guest:guest@localhost:5672/host python -c \
"import eventsender; eventsender.send_event({'type': 'event_type', 'somedata': {'key': 'value'}})"
To publish a batch, use send_events. It sends the same messages as calling send_event for each of them, but over a single connection instead of one per event:
from eventsender import send_events
send_events([
{'type': 'user.subscribed', 'username': 'john_doe'},
{'type': 'user.subscribed', 'username': 'jane_doe'},
])
Tracing
send_event and send_events create an OpenTelemetry producer span per event and inject the current trace context into the AMQP message headers, so consumers can continue the trace. This only depends on opentelemetry-api, for applications without a configured OpenTelemetry backend all tracing calls are no-ops and the behaviour is unchanged. To get the spans into your tracing backend, configure an OpenTelemetry SDK in your application (for example by enabling the Sentry SDK’s OpenTelemetry support).
Running tests
Install uv and run uv run pytest tests.
About
This software is brought to you by Byte, a webhosting provider based in Amsterdam, The Netherlands. We specialize in fast and secure Magento hosting and scalable cluster hosting.
Check out our Github page for more open source software or our site to learn about our products and technologies. Looks interesting? Reach out about joining the team. Or just drop by for a cup of excellent coffee if you’re in town!
Metadata
Release files for eventsender 1.4.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 | |
|---|---|---|---|
| eventsender-1.4.1.tar.gz | 4.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| eventsender-1.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.1 kB
Release files / eventsender-1.4.1.tar.gz
| Download URL | eventsender-1.4.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0cbb7271d0d79a9a24af8a05d366a1c0e1a788c86bed5bc3f3a99838bc3a8e9c
|
|
BLAKE2b-256 checksum How to use checksums |
f6d22d53c162140f15b57f6f6cfc5df02ca7e9f34c0ec2bc7d034480324d7e32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency logRelease files / eventsender-1.4.1-py3-none-any.whl
| Download URL | eventsender-1.4.1-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ee407d4b5c6de6945dfbe7502213bc19d9d59cf92c5cb3ab3195a7dfe24a842
|
|
BLAKE2b-256 checksum How to use checksums |
d42348ece013af0ea8138116e8d53955c0b5b884770338887b1ca10c56f2432f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency log