{ "info": { "author": "Harish Anand", "author_email": "smartcity@rbccps.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: ISC License (ISCL)", "Operating System :: MacOS", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only", "Topic :: Internet", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=======================================================\nPython SDK for IoT Data Exchange & Analytics Middleware\n=======================================================\n\nKey Features\n============\n\n- Supports IoT entities to register, publish, subscribe, access historical data.\n- Supports asynchronous access of data from the entity.\n\nInstallation\n============\n ``$ python3 -m pip install ideam``\n\n**NOTE**: Python2 is not supported.\n\nGetting started\n===============\nUsing this FORM_, you can register yourself with the middleware.\n\nAfter registering yourself as a provider of the devices/applications with the middleware, you will receive a ``OWNER API KEY``.\n\n\nRegister\n--------\nTo **register** a new entity with the (IDEAM) Middleware, you need a ``UNIQUE device name`` and the ``OWNER API KEY``:\n\n.. code-block:: python\n\n >>> from ideam.entity import Entity\n >>> deviceHandler = Entity(\"new-device-name\", \"OWNER-API-KEY\")\n >>> deviceHandler.register()\n {'APIKey': 'DEVICE-API-KEY', 'Subscription Queue Name': 'new-device-name', 'ResourceID': 'new-device-name', 'Registration': 'success'}\n >>> deviceHandler.set_entity_api_key(\"DEVICE-API-KEY\")\n DEVICE-API-KEY\n\n**NOTE**: Store the ``DEVICE-API-KEY`` obtained in the response, in a safe place. This ``DEVICE-API-KEY`` will be required for doing operations like publish, subscribe and accessing historical data.\n\nFor an Already Registered Device\n--------------------------------\nHere, we can skip the registration of the entity with the middleware.\n\n.. code-block:: python\n\n >>> from ideam.entity import Entity\n >>> deviceHandler = Entity(\"device-name\", \"OWNER-API-KEY\")\n >>> deviceHandler.set_entity_api_key(\"DEVICE-API-KEY\")\n\n\nPublish\n-------\nTo **publish** to the (IDEAM) Middleware as an IoT device/entity:\n\n\n\n Args:\n *data* (string): contents to be published by this entity.\n\n.. code-block:: python\n\n >>> from ideam.entity import Entity\n >>> deviceHandler = Entity(\"publishing-device-name\", \"OWNER-API-KEY\")\n >>> deviceHandler.set_entity_api_key(\"PUBLISHING-DEVICE-API-KEY\")\n >>> deviceHandler.publish(\"demo data\")\n {'status': 'success', 'response': 'publish message ok'}\n\n\nSubscribe\n---------\n\nTo **listen (subscribe)** to the data from a device/entity registered with the (IDEAM) Middleware, do the following steps:\n\n **Subscribe**. This method will start listening for the data from middleware. This method will automatically bind or listen to any devices provided in the argument list. When a new data from the device arrives, it is stored in an internal variable called ``subscribe_data``. The ``subscribe_data`` is a dictionary with ``data`` and ``timestamp`` field. ``timestamp`` denotes the epoch time (in milliseconds) at which data arrived.\n\n Args:\n *devices_to_bind* (list of strings): an array of devices to listen to.\n Ex: subscribe([\"test100\", \"testDemo\"])\n\n.. code-block:: python\n\n >>> from ideam.entity import Entity\n >>> applicationHandler = Entity(\"listening-device-name\", \"OWNER-API-KEY\")\n >>> applicationHandler.set_entity_api_key(\"LISTENING-DEVICE-API-KEY\")\n >>>\n >>> applicationHandler.subscribe([\"publishing-device-name\", \"publishing-device-2\"])\n >>> applicationHandler.subscribe_data\n {'data': 'demo data', 'timestamp': '1513526954674'}\n\n\nUnbind\n------\nTo unbind any entity that is already bound to, use the **unbind** method:\n\n Args:\n *devices_to_unbind* (list of strings): an array of devices that are to be unbound ( stop listening). Ex. unbind([\"test10\",\"testDemo105\"])\n\n.. code-block:: python\n\n >>> from ideam.entity import Entity\n >>> applicationHandler = Entity(\"listening-device-name\", \"OWNER-API-KEY\")\n >>> applicationHandler.set_entity_api_key(\"LISTENING-DEVICE-API-KEY\")\n >>> applicationHandler.unbind([\"publishing-device-name\"])\n {'status': 'success', 'response': 'unbind queue ok'}\n\nAccess historical data\n----------------------\nThe db function allows an entity to access the historical data.\n\n Args:\n entity (string): Name of the device to listen\n query_filters (string): Elastic search response format string. Ex. query_filters=\"pretty=true&size=10\"\n\n.. code-block:: python\n\n >>> from ideam.entity import Entity\n >>> applicationHandler = Entity(\"listening-device-name\", \"OWNER-API-KEY\")\n >>> applicationHandler.set_entity_api_key(\"LISTENING-DEVICE-API-KEY\")\n >>> applicationHandler.db(\"rbccpsEnergy.EM_D0025860\")\n '{\"took\":5,\"timed_out\":false,\"_shards\":{\"total\":5,\"successful\":5,\"failed\":0},\"hits\":{\"total\":92292,\"max_score\":1.0487294,\"hits\":[{\"_index\":\"sensor_data\",\"_type\":\"logs\",\"_id\":\"AV6AVeOG7sVBkWsIECvP\",\"_score\":1.0487294,\"_source\":{\"@timestamp\":\"2017-09-14T12:21:06.047Z\",\"data\":\"{\\\\\"YPhaseReactivePower\\\\\": 2407.9000949859619, \\\\\"BPhaseVoltage\\\\\": 239.428466796875, \\\\\"YPhaseApparentPower\\\\\": 3263.2999420166016, \\\\\"YPhaseActivePower\\\\\": 2202.8000354766846, \\\\\"RPhasePowerFactor\\\\\": 0.78799998760223389, \\\\\"BPhaseActivePower\\\\\": 2222.1999168395996, \\\\\"EnergyReactive\\\\\": 18639.000782012939, \\\\\"BPhaseCurrent\\\\\": 14.46090030670166, \\\\\"RPhaseApparentPower\\\\\": 5156.0001373291016, \\\\\"RPhaseReactivePower\\\\\": 3173.30002784729, \\\\\"YPhasePowerFactor\\\\\": 0.67400002479553223, \\\\\"RPhaseVoltage\\\\\": 234.58619689941406, \\\\\"BPhaseReactivePower\\\\\": 2654.9999713897705, \\\\\"BPhasePowerFactor\\\\\": 0.64099997282028198, \\\\\"RPhaseActivePower\\\\\": 4066.8997764587402, \\\\\"YPhaseCurrent\\\\\": 13.757100105285645, \\\\\"YPhaseVoltage\\\\\": 237.21040344238281, \\\\\"RPhaseCurrent\\\\\": 21.979299545288086, \\\\\"BPhaseApparentPower\\\\\": 3462.3000621795654, \\\\\"dataSamplingInstant\\\\\": 1505138556.0, \\\\\"EnergyActive\\\\\": 20038.0}\",\"@version\":\"1\",\"routing-key\":\"rbccpsEnergy.EM_D0025860\",\"key\":\"rbccpsEnergy.EM_D0025860\"}},{\"_index\":\"sensor_data\",\"_type\":\"logs\",\"_id\":\"AV6AQ3-E7sVBkWsIECuo\",\"_score\":1.0487294,\"_source\":{\"@timestamp\":\"2017-09-14T12:01:00.796Z\",\"data\":\"{\\\\\"YPhaseReactivePower\\\\\": 2367.5999641418457, \\\\\"BPhaseVoltage\\\\\": 238.37925720214844, \\\\\"YPhaseApparentPower\\\\\": 3248.5001087188721, \\\\\"YPhaseActivePower\\\\\": 2224.600076675415, \\\\\"RPhasePowerFactor\\\\\": 0.79400002956390381, \\\\\"BPhaseActivePower\\\\\": 2253.4999847412109, \\\\\"EnergyReactive\\\\\": 18635.600391387939, \\\\\"BPhaseCurrent\\\\\": 14.405300140380859, \\\\\"RPhaseApparentPower\\\\\": 5144.4997787475586, \\\\\"RPhaseReactivePower\\\\\": 3123.1000423431396, \\\\\"YPhasePowerFactor\\\\\": 0.68400001525878906, \\\\\"RPhaseVoltage\\\\\": 233.84330749511719, \\\\\"BPhaseReactivePower\\\\\": 2590.8999443054199, \\\\\"BPhasePowerFactor\\\\\": 0.65600001811981201, \\\\\"RPhaseActivePower\\\\\": 4091.1998748779297, \\\\\"YPhaseCurrent\\\\\": 13.756699562072754, \\\\\"YPhaseVoltage\\\\\": 236.14106750488281, \\\\\"RPhaseCurrent\\\\\": 22.0, \\\\\"BPhaseApparentPower\\\\\": 3433.9001178741455, \\\\\"dataSamplingInstant\\\\\": 1505137324.0, \\\\\"EnergyActive\\\\\": 20034.201171875}\",\"@version\":\"1\",\"routing-key\":\"rbccpsEnergy.EM_D0025860\",\"key\":\"rbccpsEnergy.EM_D0025860\"}},{\"_index\":\"sensor_data\",\"_type\":\"logs\",\"_id\":\"AV6AVBB27sVBkWsIECvK\",\"_score\":1.0487294,\"_source\":{\"@timestamp\":\"2017-09-14T12:19:06.479Z\",\"data\":\"{\\\\\"YPhaseReactivePower\\\\\": 0.0, \\\\\"BPhaseVoltage\\\\\": 0.0, \\\\\"YPhaseApparentPower\\\\\": 0.0, \\\\\"YPhaseActivePower\\\\\": 0.0, \\\\\"RPhasePowerFactor\\\\\": 0.0, \\\\\"BPhaseActivePower\\\\\": 0.0, \\\\\"EnergyReactive\\\\\": 0.0, \\\\\"BPhaseCurrent\\\\\": 0.0, \\\\\"RPhaseApparentPower\\\\\": 0.0, \\\\\"RPhaseReactivePower\\\\\": 0.0, \\\\\"YPhasePowerFactor\\\\\": 0.0, \\\\\"RPhaseVoltage\\\\\": 0.0, \\\\\"BPhaseReactivePower\\\\\": 0.0, \\\\\"BPhasePowerFactor\\\\\": 0.0, \\\\\"RPhaseActivePower\\\\\": 0.0, \\\\\"YPhaseCurrent\\\\\": 0.0, \\\\\"YPhaseVoltage\\\\\": 0.0, \\\\\"RPhaseCurrent\\\\\": 0.0, \\\\\"BPhaseApparentPower\\\\\": 0.0, \\\\\"dataSamplingInstant\\\\\": 1505138437.0, \\\\\"EnergyActive\\\\\": 0.0}\",\"@version\":\"1\",\"routing-key\":\"rbccpsEnergy.EM_D0025860\",\"key\":\"rbccpsEnergy.EM_D0025860\"}}]}}'\n\n\n.. _FORM: https://docs.google.com/forms/d/e/1FAIpQLSc-L_kMayQjpXsIZ5BU_UCBFI_v6dNPrBcmQIHp0J3kBkfyFQ/viewform?c=0&w=1\n\n ", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/rbccps-iisc/ideam-python-sdk/archive/0.0.4.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rbccps-iisc/ideam-python-sdk", "keywords": "IoT", "license": "ISC", "maintainer": "", "maintainer_email": "", "name": "ideam", "package_url": "https://pypi.org/project/ideam/", "platform": "", "project_url": "https://pypi.org/project/ideam/", "project_urls": { "Download": "https://github.com/rbccps-iisc/ideam-python-sdk/archive/0.0.4.tar.gz", "Homepage": "https://github.com/rbccps-iisc/ideam-python-sdk" }, "release_url": "https://pypi.org/project/ideam/0.0.4/", "requires_dist": null, "requires_python": "", "summary": "Python SDK for IoT Data Exchange & Analytics Middleware", "version": "0.0.4" }, "last_serial": 3496301, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "f1e0425125ef7c6d0d39968478c55794", "sha256": "7acbd1d17aa51774ff1a8f71e4cae08ea62745deb6d5bcdc2a05f70fcb0feebc" }, "downloads": -1, "filename": "ideam-0.0.1.tar.gz", "has_sig": false, "md5_digest": "f1e0425125ef7c6d0d39968478c55794", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6147, "upload_time": "2017-12-19T16:44:06", "url": "https://files.pythonhosted.org/packages/70/df/7c5284a2967aceff9253985d2648970b2de885bdfc2304e8b6196ceef19a/ideam-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "9f3b4d7122d758e64a0059b3f4017649", "sha256": "9fe45c99b692ee813b6210737323116665e9eb4ed4fe694ab1e0c30162c38eb0" }, "downloads": -1, "filename": "ideam-0.0.2.tar.gz", "has_sig": false, "md5_digest": "9f3b4d7122d758e64a0059b3f4017649", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18091, "upload_time": "2017-12-19T17:34:23", "url": "https://files.pythonhosted.org/packages/c1/ff/cee073d26d4166c1a835b8a80212772f272193586451bd6bca9c70271f79/ideam-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "198b0a631382ec5541864884fb6beb95", "sha256": "efdd3a8f856138d8341f0ec9f2ac81799b252654f93628e2bedf525810e17cf7" }, "downloads": -1, "filename": "ideam-0.0.3.tar.gz", "has_sig": false, "md5_digest": "198b0a631382ec5541864884fb6beb95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7045, "upload_time": "2018-01-05T19:58:59", "url": "https://files.pythonhosted.org/packages/8c/1c/cca9e147cb5ff72bdc1e5f313fe727d2617fba9a47c35f18f12868cb76e5/ideam-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "964d6cb05f1934d1136d1c5c34d3f390", "sha256": "90a47dd978bc095b4da1e9c332be8ef4a98896236ed101e24117064ac38577d1" }, "downloads": -1, "filename": "ideam-0.0.4.tar.gz", "has_sig": false, "md5_digest": "964d6cb05f1934d1136d1c5c34d3f390", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6949, "upload_time": "2018-01-17T06:54:44", "url": "https://files.pythonhosted.org/packages/84/81/64a50dda5d0dcb41d9e353b036c135fb8df113b592449f7d214572351e15/ideam-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "964d6cb05f1934d1136d1c5c34d3f390", "sha256": "90a47dd978bc095b4da1e9c332be8ef4a98896236ed101e24117064ac38577d1" }, "downloads": -1, "filename": "ideam-0.0.4.tar.gz", "has_sig": false, "md5_digest": "964d6cb05f1934d1136d1c5c34d3f390", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6949, "upload_time": "2018-01-17T06:54:44", "url": "https://files.pythonhosted.org/packages/84/81/64a50dda5d0dcb41d9e353b036c135fb8df113b592449f7d214572351e15/ideam-0.0.4.tar.gz" } ] }