Enos subscribe client for python
Project description
EnOS Data Subscription Service improves the API calling efficiency of applications with active data push, which supports subscription to real-time asset data, offline asset data, and asset alert data.
After configuring and starting data subscription jobs on the EnOS Management Console, you can use the Data Subscription SDK for Python to develop applications for consuming the subscribed data.
License
BSD
Installtion
The Data Subscription SDK for Python supports Python 2.7, Python 3.4, and newer versions.
You can use “python setup.py install” or “pip install enos-subscribe” to install this SDK.
This SDK has the following dependency modules:
six
google.protobuf
websocket_client
Code Sample
Code Sample for Consuming Subscribed Real-time Data
from enos_subscribe import DataClient
if __name__ == '__main__':
client = DataClient(host='sub-host', port='sub-port',
access_key='Your Access Key of this subscription',
access_secret='Your Access Secret of this subscription')
client.subscribe(sub_id='Your subscription Id')
for message in client:
print(message)
Code Sample for Consuming Subscribed Alert Data
from enos_subscribe import AlertClient
if __name__ == '__main__':
client = AlertClient(host='sub-host', port='sub-port',
access_key='Your Access Key of this subscription',
access_secret='Your Access Secret of this subscription')
client.subscribe(sub_id='Your subscription Id')
for message in client:
print(message)
Code Sample for Consuming Subscribed Offline Data
from enos_subscribe import OfflineDataClient
if __name__ == '__main__':
client = OfflineDataClient(host='sub-host', port='sub-port',
access_key='Your Access Key of this subscription',
access_secret='Your Access Secret of this subscription')
client.subscribe(sub_id='Your subscription Id')
for message in client:
print(message)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for enos_subscribe-2.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c266d91a9e250dd440013eba1516509883d11a8e922512e4ccf9790baff6d10 |
|
MD5 | 93a9193f4552d3ee0aaa1b0832e409e4 |
|
BLAKE2b-256 | 01d64b8ec8c4c42b921bf712eed77b9cac63be119fd4da0ae62f8359b7672758 |