Metadata-Version: 2.1
Name: pyhermes
Version: 0.4.3
Summary: The Python interface to the Hermes message broker.
Home-page: https://github.com/allegro/pyhermes
Author: Allegrogroup
Author-email: pylabs@allegro.pl
License: Apache Software License
Keywords: pyhermes
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.7
Classifier: Framework :: Django :: 1.8
Classifier: Framework :: Django :: 1.9
Classifier: Framework :: Django :: 3.1
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Description-Content-Type: text/markdown
Requires-Dist: six
Requires-Dist: requests

## pyhermes

[![Version Badge](https://badge.fury.io/py/pyhermes.png)](https://badge.fury.io/py/pyhermes.png)
[![Build Status](https://travis-ci.org/allegro/pyhermes.png?branch=master)](https://travis-ci.org/allegro/pyhermes)

The Python interface to the [Hermes](http://hermes.allegro.tech) message broker.

## Documentation

The full documentation is at https://pyhermes.readthedocs.org.

## Installation

To install pyhermes, simply:

```python
pip install pyhermes
```

Then use it in a project:

```python
import pyhermes
```

## Features

* TODO

## Quickstart

### Subscriber

To create handler for particular subscription topic decorate your function using `subscribe` decorator:

```python
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:

```python
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:

```python
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?

```python
source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements/test.txt
(myenv) $ python runtests.py
```

## Credits

Tools used in rendering this package:

*  [Cookiecutter](https://github.com/audreyr/cookiecutter)
*  [cookiecutter-djangopackage](https://github.com/pydanny/cookiecutter-djangopackage)



# History

## 0.3.0 (2016-12-29)

* Retry publishing to hermes in case of failure (default: 3x)
* Support for Python3.6, Django 1.10 and Django development version in tests


## 0.2.1 (2016-12-12)

* Configure custom label for django app #11


## 0.2.0 (2016-11-03)

* Fix ambiguity with pyhermes.decorators.subscriber (rename subscriber module to subscription)


## 0.1.3 (2016-06-21)

* Allow for custom wrapper around subcriber function
* Additional logging for event id and retry count
* Added support for Django <= 1.7
* Raw data is dumped only to debug logs.


## 0.1.2 (2016-04-20)

* New management command for testing Hermes connection


## 0.1.0 (2016-04-13)

* First release on PyPI.


