Skip to main content

Python bindings for Snips Hermes Protocol

Project description

# Hermes Python
[![Build Status](https://travis-ci.org/snipsco/hermes-protocol.svg?branch=hermes-python-ffi)](https://travis-ci.org/snipsco/hermes-protocol)
[![PyPI version](https://badge.fury.io/py/hermes-python.svg)](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.




Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

hermes_python-0.1.25-cp37-cp37m-manylinux1_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.7m

hermes_python-0.1.25-cp37-cp37m-macosx_10_13_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.7mmacOS 10.13+ x86-64

hermes_python-0.1.25-cp36-cp36m-manylinux1_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.6m

hermes_python-0.1.25-cp36-cp36m-macosx_10_9_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

hermes_python-0.1.25-cp35-cp35m-manylinux1_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.5m

hermes_python-0.1.25-cp35-cp35m-linux_armv7l.whl (2.7 MB view details)

Uploaded CPython 3.5m

hermes_python-0.1.25-cp35-cp35m-linux_armv6l.whl (2.7 MB view details)

Uploaded CPython 3.5m

hermes_python-0.1.25-cp34-cp34m-manylinux1_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.4m

hermes_python-0.1.25-cp27-cp27mu-manylinux1_x86_64.whl (2.8 MB view details)

Uploaded CPython 2.7mu

hermes_python-0.1.25-cp27-cp27mu-linux_armv7l.whl (2.7 MB view details)

Uploaded CPython 2.7mu

hermes_python-0.1.25-cp27-cp27mu-linux_armv6l.whl (2.7 MB view details)

Uploaded CPython 2.7mu

hermes_python-0.1.25-cp27-cp27m-manylinux1_x86_64.whl (2.8 MB view details)

Uploaded CPython 2.7m

hermes_python-0.1.25-cp27-cp27m-macosx_10_13_x86_64.whl (3.6 MB view details)

Uploaded CPython 2.7mmacOS 10.13+ x86-64

File details

Details for the file hermes_python-0.1.25-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: hermes_python-0.1.25-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.7m
  • Uploaded using 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

File hashes

Hashes for hermes_python-0.1.25-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bb0bd39eeebbda005858f8ae98f41e698fd563a31bbb8bfa9849a0a9c4e1b5e9
MD5 20e17b04a60cb23c0e85bd752dbd3295
BLAKE2b-256 0a1a50b9f3cd5e4b7b368daaa26e6af085defe16c8cb2a9f3b887459c0d73ec6

See more details on using hashes here.

File details

Details for the file hermes_python-0.1.25-cp37-cp37m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: hermes_python-0.1.25-cp37-cp37m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.7m, macOS 10.13+ x86-64
  • Uploaded using 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

File hashes

Hashes for hermes_python-0.1.25-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 0cf639c64ba98775d7e9536e0ab027eb707c7a5517ff959971221b9c47d6af2f
MD5 27f8d83338ce6ebd9abc683faa032205
BLAKE2b-256 7d9881971ecea157d2bae13e6d52bc81ffc132b948342af1b5017709e74a7795

See more details on using hashes here.

File details

Details for the file hermes_python-0.1.25-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: hermes_python-0.1.25-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.6m
  • Uploaded using 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

File hashes

Hashes for hermes_python-0.1.25-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c6e0ff7bc141382132c63eefa5b521144c5aa29f5cdd1016ae4732f082a75e90
MD5 ed956550fcaa344e05bee7d591c7a243
BLAKE2b-256 e57662203175f51d7fb66963d05641d02f5b677a8148c3cda0ae303f70140f54

See more details on using hashes here.

File details

Details for the file hermes_python-0.1.25-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: hermes_python-0.1.25-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using 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

File hashes

Hashes for hermes_python-0.1.25-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 78d7d7340dcfc47224f3f10ce1898ae848a45ae043fcad17fa0abf5c839c15c3
MD5 565c2675e92f3728933ab5db727302e5
BLAKE2b-256 df2c3acc8c7495ebf18bd29acb85b50f74f91635a573e8fe83e822c0369f6daa

See more details on using hashes here.

File details

Details for the file hermes_python-0.1.25-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: hermes_python-0.1.25-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.5m
  • Uploaded using 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

File hashes

Hashes for hermes_python-0.1.25-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2c9188bb4ec6ca8a157f27ef02cdb138a9ec375396685dca3dca9dfa27b075b6
MD5 a6daac68745371f4bbbaa9ecd0b29cfc
BLAKE2b-256 363e65f5c12790b061fa9a7ef14aca8c042c0f9fc92b525548475f21457b3e3a

See more details on using hashes here.

File details

Details for the file hermes_python-0.1.25-cp35-cp35m-linux_armv7l.whl.

File metadata

  • Download URL: hermes_python-0.1.25-cp35-cp35m-linux_armv7l.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.5m
  • Uploaded using 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

File hashes

Hashes for hermes_python-0.1.25-cp35-cp35m-linux_armv7l.whl
Algorithm Hash digest
SHA256 ff6bb77942645478d0204c2ef0d051edfa42aa0d2acad335c0996b7c5d382f6a
MD5 198bb164c338652177692da1ac40c8d2
BLAKE2b-256 e84edd3befb20d4d1e3ebd14dccbf496a46fadc5ef637dc24fd135a8b385b43f

See more details on using hashes here.

File details

Details for the file hermes_python-0.1.25-cp35-cp35m-linux_armv6l.whl.

File metadata

  • Download URL: hermes_python-0.1.25-cp35-cp35m-linux_armv6l.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.5m
  • Uploaded using 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

File hashes

Hashes for hermes_python-0.1.25-cp35-cp35m-linux_armv6l.whl
Algorithm Hash digest
SHA256 c97801557cb85b31c420e45b82dc45b0da78100d04fd8a5f2b8cd5853e17749d
MD5 b45e53e8d19f7e10e5772ef25733de56
BLAKE2b-256 93b30e3adf7bf8313896161f267fc1344b4930b6e21cc7ec042dd06499172baa

See more details on using hashes here.

File details

Details for the file hermes_python-0.1.25-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

  • Download URL: hermes_python-0.1.25-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.4m
  • Uploaded using 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

File hashes

Hashes for hermes_python-0.1.25-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 abb8a904e4733143e6c0638b12afe5496788715b82f05690a0c84d89878f6be3
MD5 45b212e9af1698aeade96344d6bdcaa5
BLAKE2b-256 f0e1eba818a8f289a5295e0e1eaa8803d4d78c7efb791be4da87f50c3677341c

See more details on using hashes here.

File details

Details for the file hermes_python-0.1.25-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

  • Download URL: hermes_python-0.1.25-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 2.7mu
  • Uploaded using 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

File hashes

Hashes for hermes_python-0.1.25-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 424cc8bb475c6fa9c98c68bd016df793254fc82510aa952a57c846d384bd077e
MD5 70a6f2ed182a4a1cf680fd42ef9b1c00
BLAKE2b-256 a346916979921961e249981f8c618023a2dafc3d5b68f0b1c8c8e4160416bedd

See more details on using hashes here.

File details

Details for the file hermes_python-0.1.25-cp27-cp27mu-linux_armv7l.whl.

File metadata

  • Download URL: hermes_python-0.1.25-cp27-cp27mu-linux_armv7l.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 2.7mu
  • Uploaded using 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

File hashes

Hashes for hermes_python-0.1.25-cp27-cp27mu-linux_armv7l.whl
Algorithm Hash digest
SHA256 a2d91f5be83c26e3f2e94aa4834dafb25a81e68a994be55c63add55ce5b75d2a
MD5 493ecfa034e56af26e6075400bd02111
BLAKE2b-256 29c946415f5ab9a89684ce3df848bf9ec8e59a0ea5e405e81a57c30eb669f7df

See more details on using hashes here.

File details

Details for the file hermes_python-0.1.25-cp27-cp27mu-linux_armv6l.whl.

File metadata

  • Download URL: hermes_python-0.1.25-cp27-cp27mu-linux_armv6l.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 2.7mu
  • Uploaded using 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

File hashes

Hashes for hermes_python-0.1.25-cp27-cp27mu-linux_armv6l.whl
Algorithm Hash digest
SHA256 62dbba690f86df37b892b6678df78934ad9b9a653df38f78ee384623ee02ee93
MD5 29d6da28bebf6193f49492a74eb4f2cb
BLAKE2b-256 736b613953aee09384e9a509123c962740b3e3b90ec704ef4a81e03700f21a96

See more details on using hashes here.

File details

Details for the file hermes_python-0.1.25-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

  • Download URL: hermes_python-0.1.25-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 2.7m
  • Uploaded using 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

File hashes

Hashes for hermes_python-0.1.25-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 aeb1216304a2907bb5f34ebc459569cdbea532e3784d857119a5b192b025faa8
MD5 3a259fb50a590ce9356163427494fdad
BLAKE2b-256 89a8f3d7c81ebe5ee523ce6fb842e69ba9a5d5e16872ca73d5b851c622794c22

See more details on using hashes here.

File details

Details for the file hermes_python-0.1.25-cp27-cp27m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: hermes_python-0.1.25-cp27-cp27m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 2.7m, macOS 10.13+ x86-64
  • Uploaded using 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

File hashes

Hashes for hermes_python-0.1.25-cp27-cp27m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 0d2d68eb2530f234aa570b47059584012efa4f0a7bf60331c8d6a88910c8ee91
MD5 89e26ebe3bce39f55aa2ec1d3b08a563
BLAKE2b-256 7f6d92746e6523970636e7c2b47504305e51ec345d30bc92fe85c032bf9ffd22

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page