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


Download files

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

Source Distribution

enos_subscribe-2.4.1.tar.gz (19.8 kB view hashes)

Uploaded Source

Built Distribution

enos_subscribe-2.4.1-py3-none-any.whl (22.3 kB view hashes)

Uploaded Python 3

Supported by

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