pyhermes
The Python interface to the Hermes message broker.
Documentation
The full documentation is at https://pyhermes.readthedocs.org.
Installation
To install pyhermes, simply:
pip install pyhermes
Then use it in a project:
import pyhermes
Features
- TODO
Quickstart
Subscriber
To create handler for particular subscription topic decorate your function using subscribe decorator:
import pyhermes
@pyhermes.subscriber(topic='pl.allegro.pyhermes.sample-topic')
def handler(data):
# process data
This function will be called every time there is new message published to the selected topic.
Publisher
Use publish function to publish data to some topic in hermes:
import pyhermes
@pyhermes.publisher(topic='pl.allegro.pyhermes.sample-topic')
def my_complex_function(a, b, c):
result = a + b + c
publish(my_complex_function._topic, {'complex_result': result})
You could publish directly result of the function as well:
import pyhermes
@pyhermes.publisher(topic='pl.allegro.pyhermes.sample-topic', auto_publish_result=True)
def my_complex_function(a, b, c):
return {'complex_result': a + b + c}
Result of decorated function is automatically published to selected topic in hermes.
Running Tests
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements/test.txt
(myenv) $ python runtests.py
Credits
Tools used in rendering this package:
Metadata
Release files for pyhermes 0.7.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 | |
|---|---|---|---|---|
| pyhermes-0.7.1.tar.gz | 11.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyhermes-0.7.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.0 kB
Release files / pyhermes-0.7.1.tar.gz
| Download URL | pyhermes-0.7.1.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a1ac14cde58424e87feb9822bb29717bbaaf7c7c745c282f28629f6614733c7
|
|
BLAKE2b-256 checksum How to use checksums |
185aa0a18faf03818a9f4c18660ec3e18013c4baa542b13fb2822b94c6f230d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.13
|
Release files / pyhermes-0.7.1-py3-none-any.whl
| Download URL | pyhermes-0.7.1-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6ec1b15ac166f1f0a8835e8a3660c84800838e6ae7e21d79d5cb7c8c776a6f5
|
|
BLAKE2b-256 checksum How to use checksums |
1c41a4bd3a33dbeb19e966901632467b2de2bc42e3a9e6fe3e87ae5b735003c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.13
|
Security for pyhermes 0.7.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.