Skip to main content

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

Download files

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

Files for enos-subscribe, version 2.4.1
Filename, size File type Python version Upload date Hashes
Filename, size enos_subscribe-2.4.1-py3-none-any.whl (22.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size enos_subscribe-2.4.1.tar.gz (19.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page