amqpconsumer
A Python module to facilitate listening for and acting on AMQP events.
Usage
Example:
import logging
from amqpconsumer.events import EventConsumer
def handler(event):
print("Got event:", event)
def main():
logging.basicConfig(level=logging.INFO)
consumer = EventConsumer('amqp://guest:guest@localhost:5672/%2f',
'testqueue',
handler)
try:
consumer.run()
except KeyboardInterrupt:
consumer.stop()
if __name__ == '__main__':
main()
Tracing
For every consumed message the consumer extracts OpenTelemetry trace context from the AMQP message headers and wraps the handler call in a consumer span, continuing the publisher’s trace when the message carries one (messages without trace headers simply start a trace of their own). 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. Look 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 amqpconsumer 1.8.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 |
|---|---|---|---|---|
| amqpconsumer-1.8.1.tar.gz | 8.7 kB | With provenance | Details for amqpconsumer-1.8.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| amqpconsumer-1.8.1-py3-none-any.whl | Python 3 | none | any | Details for amqpconsumer-1.8.1-py3-none-any.whl |
Total release size: 16.6 kB
Release files / amqpconsumer-1.8.1.tar.gz
| Download URL | amqpconsumer-1.8.1.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
968d6e8c0e29779e5d742a6c8d57219850b434d86ad9ca926670a388ff3979b6
|
|
BLAKE2b-256 checksum How to use checksums |
d74f77911f8898f88bca11e0e0818c7a0c4dad73a0cf0bd511aa3e71d3da85bf
|
| 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 / amqpconsumer-1.8.1-py3-none-any.whl
| Download URL | amqpconsumer-1.8.1-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5a622cea981a74b11f2252bead403e47fd3d9cd211442e13401b58982baa869
|
|
BLAKE2b-256 checksum How to use checksums |
1707ec02f3677d470375044976ee7a2ec2aaec00d9ad0216fd15863e4985369e
|
| 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 logSecurity for amqpconsumer 1.8.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for amqpconsumer-1.8.1.tar.gz
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 logA 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.