# Hermes Python
[](https://travis-ci.org/snipsco/hermes-protocol)
[](https://badge.fury.io/py/hermes-python)
The `hermes-python` library provides python bindings for the Hermes protocol that snips components use to communicate together.
`hermes-python` allows you to interface seamlessly with the Snips platform and quick start development of Voice applications.
`hermes-python` abstracts away the connection to the MQTT bus and the parsing of incoming and outcoming messages from and to the components of the snips platform.
## Installation
The library is packaged as a pre-compiled platform wheel, available on [PyPi](https://pypi.org/project/hermes-python/).
It can be installed with :
```
pip install hermes-python
```
Or you can add it to your `requirements.txt` file.
### Requirements
The wheel is available for Python 2.7+ and Python 3.5
The wheel supports the following platform tags :
- `manylinux1_x86_64`
- `armv7l`, `armv6`
- `macos`
## Usage
The lifecycle of a script using `hermes-python` has the following steps :
- Initiating a connection to the MQTT broker
- Registering callback functions to handle incoming intent parsed by the snips platform
- Listening to incoming intents
- Closing the connection
Let's quickly dive into an example : Let's write an app for a Weather Assistant !
This code implies that you created a weather assistant using the [snips Console](https://console.snips.ai), and that it has a *`searchWeatherForecast`* intent.
Here is a code example for `python2.7` :
```
from hermes_python.hermes import Hermes
MQTT_ADDR = "localhost:1883" # Specify host and port for the MQTT broker
def subscribe_weather_forecast_callback(hermes, intentMessage): # Defining callback functions to handle an intent that asks for the weather.
print("Parsed intent : {}".format(intentMessage.intent.intent_name))
with Hermes(MQTT_ADDR) as h: # Initialization of a connection to the MQTT broker
h.subscribe_intent("searchWeatherForecast", subscribe_weather_forecast_callback) \ # Registering callback functions to handle the searchWeatherForecast intent
.start()
# We get out of the with block, which closes and releases the connection.
```
### Examples
#### Handling the `intent_message` object
*Coming soon.*
#### Providing TTS feedback for a voice application
*Coming soon.*
## Documentation
### Hermes protocol documentation
If you want to dive deeper into how Snips components communicate together, check out the specification of the `hermes-protocol` [here](https://docs.snips.ai/ressources/hermes-protocol).
You can also check this repository for other language bindings.
### API
*Coming soon.*
## History
### 0.1.25 (2018-12-13)
* Better error handling : Errors from wrapped C library throw a LibException with detailled errors.
[](https://travis-ci.org/snipsco/hermes-protocol)
[](https://badge.fury.io/py/hermes-python)
The `hermes-python` library provides python bindings for the Hermes protocol that snips components use to communicate together.
`hermes-python` allows you to interface seamlessly with the Snips platform and quick start development of Voice applications.
`hermes-python` abstracts away the connection to the MQTT bus and the parsing of incoming and outcoming messages from and to the components of the snips platform.
## Installation
The library is packaged as a pre-compiled platform wheel, available on [PyPi](https://pypi.org/project/hermes-python/).
It can be installed with :
```
pip install hermes-python
```
Or you can add it to your `requirements.txt` file.
### Requirements
The wheel is available for Python 2.7+ and Python 3.5
The wheel supports the following platform tags :
- `manylinux1_x86_64`
- `armv7l`, `armv6`
- `macos`
## Usage
The lifecycle of a script using `hermes-python` has the following steps :
- Initiating a connection to the MQTT broker
- Registering callback functions to handle incoming intent parsed by the snips platform
- Listening to incoming intents
- Closing the connection
Let's quickly dive into an example : Let's write an app for a Weather Assistant !
This code implies that you created a weather assistant using the [snips Console](https://console.snips.ai), and that it has a *`searchWeatherForecast`* intent.
Here is a code example for `python2.7` :
```
from hermes_python.hermes import Hermes
MQTT_ADDR = "localhost:1883" # Specify host and port for the MQTT broker
def subscribe_weather_forecast_callback(hermes, intentMessage): # Defining callback functions to handle an intent that asks for the weather.
print("Parsed intent : {}".format(intentMessage.intent.intent_name))
with Hermes(MQTT_ADDR) as h: # Initialization of a connection to the MQTT broker
h.subscribe_intent("searchWeatherForecast", subscribe_weather_forecast_callback) \ # Registering callback functions to handle the searchWeatherForecast intent
.start()
# We get out of the with block, which closes and releases the connection.
```
### Examples
#### Handling the `intent_message` object
*Coming soon.*
#### Providing TTS feedback for a voice application
*Coming soon.*
## Documentation
### Hermes protocol documentation
If you want to dive deeper into how Snips components communicate together, check out the specification of the `hermes-protocol` [here](https://docs.snips.ai/ressources/hermes-protocol).
You can also check this repository for other language bindings.
### API
*Coming soon.*
## History
### 0.1.25 (2018-12-13)
* Better error handling : Errors from wrapped C library throw a LibException with detailled errors.
Release files for hermes-python 0.1.25
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| hermes_python-0.1.25-cp37-cp37m-manylinux1_x86_64.whl | CPython 3.7 | CPython 3.7 pymalloc | Linux glibc 2.5+ x86-64 | Details |
| hermes_python-0.1.25-cp37-cp37m-macosx_10_13_x86_64.whl | CPython 3.7 | CPython 3.7 pymalloc | macOS 10.13+ x86-64 | Details |
| hermes_python-0.1.25-cp36-cp36m-manylinux1_x86_64.whl | CPython 3.6 | CPython 3.6 pymalloc | Linux glibc 2.5+ x86-64 | Details |
| hermes_python-0.1.25-cp36-cp36m-macosx_10_9_x86_64.whl | CPython 3.6 | CPython 3.6 pymalloc | macOS 10.9+ x86-64 | Details |
| hermes_python-0.1.25-cp35-cp35m-manylinux1_x86_64.whl | CPython 3.5 | CPython 3.5 pymalloc | Linux glibc 2.5+ x86-64 | Details |
| hermes_python-0.1.25-cp35-cp35m-linux_armv7l.whl | CPython 3.5 | CPython 3.5 pymalloc | linux armv7l | Details |
| hermes_python-0.1.25-cp35-cp35m-linux_armv6l.whl | CPython 3.5 | CPython 3.5 pymalloc | linux armv6l | Details |
| hermes_python-0.1.25-cp34-cp34m-manylinux1_x86_64.whl | CPython 3.4 | CPython 3.4 pymalloc | Linux glibc 2.5+ x86-64 | Details |
| hermes_python-0.1.25-cp27-cp27mu-manylinux1_x86_64.whl | CPython 2.7 | CPython 2.7 pymalloc wide-unicode | Linux glibc 2.5+ x86-64 | Details |
| hermes_python-0.1.25-cp27-cp27mu-linux_armv7l.whl | CPython 2.7 | CPython 2.7 pymalloc wide-unicode | linux armv7l | Details |
| hermes_python-0.1.25-cp27-cp27mu-linux_armv6l.whl | CPython 2.7 | CPython 2.7 pymalloc wide-unicode | linux armv6l | Details |
| hermes_python-0.1.25-cp27-cp27m-manylinux1_x86_64.whl | CPython 2.7 | CPython 2.7 pymalloc | Linux glibc 2.5+ x86-64 | Details |
| hermes_python-0.1.25-cp27-cp27m-macosx_10_13_x86_64.whl | CPython 2.7 | CPython 2.7 pymalloc | macOS 10.13+ x86-64 | Details |
Total release size: 38.5 MB
Release files / hermes_python-0.1.25-cp37-cp37m-manylinux1_x86_64.whl
| Download URL | hermes_python-0.1.25-cp37-cp37m-manylinux1_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
bb0bd39eeebbda005858f8ae98f41e698fd563a31bbb8bfa9849a0a9c4e1b5e9
|
|
BLAKE2b-256 checksum How to use checksums |
0a1a50b9f3cd5e4b7b368daaa26e6af085defe16c8cb2a9f3b887459c0d73ec6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.13
|
Release files / hermes_python-0.1.25-cp37-cp37m-macosx_10_13_x86_64.whl
| Download URL | hermes_python-0.1.25-cp37-cp37m-macosx_10_13_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
0cf639c64ba98775d7e9536e0ab027eb707c7a5517ff959971221b9c47d6af2f
|
|
BLAKE2b-256 checksum How to use checksums |
7d9881971ecea157d2bae13e6d52bc81ffc132b948342af1b5017709e74a7795
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15
|
Release files / hermes_python-0.1.25-cp36-cp36m-manylinux1_x86_64.whl
| Download URL | hermes_python-0.1.25-cp36-cp36m-manylinux1_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
c6e0ff7bc141382132c63eefa5b521144c5aa29f5cdd1016ae4732f082a75e90
|
|
BLAKE2b-256 checksum How to use checksums |
e57662203175f51d7fb66963d05641d02f5b677a8148c3cda0ae303f70140f54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.13
|
Release files / hermes_python-0.1.25-cp36-cp36m-macosx_10_9_x86_64.whl
| Download URL | hermes_python-0.1.25-cp36-cp36m-macosx_10_9_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
78d7d7340dcfc47224f3f10ce1898ae848a45ae043fcad17fa0abf5c839c15c3
|
|
BLAKE2b-256 checksum How to use checksums |
df2c3acc8c7495ebf18bd29acb85b50f74f91635a573e8fe83e822c0369f6daa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15
|
Release files / hermes_python-0.1.25-cp35-cp35m-manylinux1_x86_64.whl
| Download URL | hermes_python-0.1.25-cp35-cp35m-manylinux1_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
2c9188bb4ec6ca8a157f27ef02cdb138a9ec375396685dca3dca9dfa27b075b6
|
|
BLAKE2b-256 checksum How to use checksums |
363e65f5c12790b061fa9a7ef14aca8c042c0f9fc92b525548475f21457b3e3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.13
|
Release files / hermes_python-0.1.25-cp35-cp35m-linux_armv7l.whl
| Download URL | hermes_python-0.1.25-cp35-cp35m-linux_armv7l.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.5 CPython 3.5 pymalloc linux armv7l |
|
SHA-256 checksum How to use checksums |
ff6bb77942645478d0204c2ef0d051edfa42aa0d2acad335c0996b7c5d382f6a
|
|
BLAKE2b-256 checksum How to use checksums |
e84edd3befb20d4d1e3ebd14dccbf496a46fadc5ef637dc24fd135a8b385b43f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.13
|
Release files / hermes_python-0.1.25-cp35-cp35m-linux_armv6l.whl
| Download URL | hermes_python-0.1.25-cp35-cp35m-linux_armv6l.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.5 CPython 3.5 pymalloc linux armv6l |
|
SHA-256 checksum How to use checksums |
c97801557cb85b31c420e45b82dc45b0da78100d04fd8a5f2b8cd5853e17749d
|
|
BLAKE2b-256 checksum How to use checksums |
93b30e3adf7bf8313896161f267fc1344b4930b6e21cc7ec042dd06499172baa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.13
|
Release files / hermes_python-0.1.25-cp34-cp34m-manylinux1_x86_64.whl
| Download URL | hermes_python-0.1.25-cp34-cp34m-manylinux1_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.4 CPython 3.4 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
abb8a904e4733143e6c0638b12afe5496788715b82f05690a0c84d89878f6be3
|
|
BLAKE2b-256 checksum How to use checksums |
f0e1eba818a8f289a5295e0e1eaa8803d4d78c7efb791be4da87f50c3677341c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.13
|
Release files / hermes_python-0.1.25-cp27-cp27mu-manylinux1_x86_64.whl
| Download URL | hermes_python-0.1.25-cp27-cp27mu-manylinux1_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
424cc8bb475c6fa9c98c68bd016df793254fc82510aa952a57c846d384bd077e
|
|
BLAKE2b-256 checksum How to use checksums |
a346916979921961e249981f8c618023a2dafc3d5b68f0b1c8c8e4160416bedd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.13
|
Release files / hermes_python-0.1.25-cp27-cp27mu-linux_armv7l.whl
| Download URL | hermes_python-0.1.25-cp27-cp27mu-linux_armv7l.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 2.7 CPython 2.7 pymalloc wide-unicode linux armv7l |
|
SHA-256 checksum How to use checksums |
a2d91f5be83c26e3f2e94aa4834dafb25a81e68a994be55c63add55ce5b75d2a
|
|
BLAKE2b-256 checksum How to use checksums |
29c946415f5ab9a89684ce3df848bf9ec8e59a0ea5e405e81a57c30eb669f7df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.13
|
Release files / hermes_python-0.1.25-cp27-cp27mu-linux_armv6l.whl
| Download URL | hermes_python-0.1.25-cp27-cp27mu-linux_armv6l.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 2.7 CPython 2.7 pymalloc wide-unicode linux armv6l |
|
SHA-256 checksum How to use checksums |
62dbba690f86df37b892b6678df78934ad9b9a653df38f78ee384623ee02ee93
|
|
BLAKE2b-256 checksum How to use checksums |
736b613953aee09384e9a509123c962740b3e3b90ec704ef4a81e03700f21a96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.13
|
Release files / hermes_python-0.1.25-cp27-cp27m-manylinux1_x86_64.whl
| Download URL | hermes_python-0.1.25-cp27-cp27m-manylinux1_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
aeb1216304a2907bb5f34ebc459569cdbea532e3784d857119a5b192b025faa8
|
|
BLAKE2b-256 checksum How to use checksums |
89a8f3d7c81ebe5ee523ce6fb842e69ba9a5d5e16872ca73d5b851c622794c22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.13
|
Release files / hermes_python-0.1.25-cp27-cp27m-macosx_10_13_x86_64.whl
| Download URL | hermes_python-0.1.25-cp27-cp27m-macosx_10_13_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 2.7 CPython 2.7 pymalloc macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
0d2d68eb2530f234aa570b47059584012efa4f0a7bf60331c8d6a88910c8ee91
|
|
BLAKE2b-256 checksum How to use checksums |
7f6d92746e6523970636e7c2b47504305e51ec345d30bc92fe85c032bf9ffd22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15
|