{ "info": { "author": "David Parker", "author_email": "parkerda@uk.ibm.com", "bugtrack_url": null, "classifiers": [], "description": "IBM Internet of Things Cloud for Python\n=======================================\n\nPython module for interacting with the IBM Internet of Things Cloud with\nPython.\n\nPlatform\n--------\n\n- `Python 2.7 `__\n\nDependencies\n------------\n\n- `paho-mqtt `__\n- `iso8601 `__\n\nInstallation\n------------\n\nThis module is not yet available in PyPi, however you can download the\nlatest release and use pip's ability to install from a file.\n\n::\n\n [root@localhost ~]# pip install ibmiotc-version.zip\n\nUninstall\n---------\n\nUninstalling the module is simple.\n\n::\n\n [root@localhost ~]# pip uninstall ibmiotc\n\nDocumentation\n-------------\n\nApplication Client\n~~~~~~~~~~~~~~~~~~\n\nConstructor\n^^^^^^^^^^^\n\nThe Client constructor accepts an options dict containing: \\* org - Your\norganization ID \\* id - The unique ID of your application within your\norganization \\* authMethod - Method of authentication (the only value of\nauthMethod currently supported is \"apikey\") \\* authKey - API key\n(required if authMethod is \"apikey\") \\* authToken - API key token\n(required if authMethod is \"apikey\")\n\n.. code:: python\n\n import ibmiotc.application\n try:\n options = {\"org\": organization, \"id\": appId, \"auth-method\": authMethod, \"auth-key\": authKey, \"auth-token\": authToken}\n client = ibmiotc.application.Client(options)\n except ibmiotc.ConnectionException as e:\n ...\n\nUsing a Configuration File\n''''''''''''''''''''''''''\n\n.. code:: python\n\n import ibmiotc.application\n try:\n options = ibmiotc.application.ParseConfigFile(configFilePath)\n client = ibmiotc.application.Client(options)\n except ibmiotc.ConnectionException as e:\n ...\n\nThe application configuration file must be in the following format:\n\n::\n\n org=$orgId\n id=$myApplication\n auth-method=apikey\n auth-key=$key\n auth-token=$token\n\nSubscribing to Device events\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nBy default, this will subscribe to all events from all connected\ndevices. Use the type, id and event parameters to control the scope of\nthe subscription. A single client can support multiple subscriptions.\n\nSubscribe to all events from all devices\n''''''''''''''''''''''''''''''''''''''''\n\n.. code:: python\n\n client.subscribeToDeviceEvents()\n\nSubscribe to all events from all devices of a specific type\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\n.. code:: python\n\n client.subscribeToDeviceEvents(deviceType=myDeviceType)\n\nSubscribe to a specific event from all devices\n''''''''''''''''''''''''''''''''''''''''''''''\n\n.. code:: python\n\n client.subscribeToDeviceEvents(event=myEvent)\n\nSubscribe to a specific event from two different devices\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\n.. code:: python\n\n client.subscribeToDeviceEvents(deviceType=myDeviceType, deviceId=myDeviceId, event=myEvent)\n lient.subscribeToDeviceEvents(deviceType=myOtherDeviceType, deviceId=myOtherDeviceId, event=myEvent)\n\nHandling events from Devices\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo process the events received by your subscroptions you need to\nregister an event callback method. The messages are returned as an\ninstance of the Event class: \\* event.device - string (uniquely\nidentifies the device across all types of devices in the organization\n:math:`deviceType:`\\ deviceId) \\* event.deviceType - string \\*\nevent.deviceId - string \\* event.event - string \\* event.format - string\n\\* event.data - dict \\* event.timestamp - datetime\n\n.. code:: python\n\n def myEventCallback(event):\n print \"%s event '%s' received from device [%s]: %s\" % (event.format, event.event, event.device, json.dumps(event.data))\n\n ...\n client.eventCallback = myEventCallback\n client.subscribeToDeviceEvents()\n\nSubscribing to Device status\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nBy default, this will subscribe to status updates for all connected\ndevices. Use the type and id parameters to control the scope of the\nsubscription. A single client can support multiple subscriptions.\n\nSubscribe to status updates for all devices\n'''''''''''''''''''''''''''''''''''''''''''\n\n.. code:: python\n\n client.subscribeToDeviceStatus()\n\nSubscribe to status updates for all devices of a specific type\n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\n.. code:: python\n\n client.subscribeToDeviceStatus(deviceType=myDeviceType)\n\nSubscribe to status updates for two different devices\n'''''''''''''''''''''''''''''''''''''''''''''''''''''\n\n.. code:: python\n\n client.subscribeToDeviceStatus(deviceType=myDeviceType, deviceId=myDeviceId)\n lient.subscribeToDeviceStatus(deviceType=myOtherDeviceType, deviceId=myOtherDeviceId)\n\nHandling status updates from Devices\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo process the status updates received by your subscriptions you need to\nregister an event callback method. The messages are returned as an\ninstance of the Status class:\n\n| The following properties are set for both \"Connect\" and \"Disconnect\"\nstatus events: \\* status.clientAddr - string\n| \\* status.protocol - string\n| \\* status.clientId - string\n| \\* status.user - string\n| \\* status.time - datetime\n| \\* status.action - string\n| \\* status.connectTime - datetime\n| \\* status.port - int\n\n| The following properties are only set when the action is \"Disconnect\":\n\\* status.writeMsg - int \\* status.readMsg - int \\* status.reason -\nstring\n| \\* status.readBytes - int\n| \\* status.writeBytes - int\n\n.. code:: python\n\n def myStatusCallback(status):\n if status.action == \"Disconnect\":\n print \"%s - device %s - %s (%s)\" % (status.time.isoformat(), status.device, status.action, status.reason)\n else:\n print \"%s - %s - %s\" % (status.time.isoformat(), status.device, status.action)\n\n ...\n client.statusCallback = myStatusCallback\n client.subscribeToDeviceStstus()\n\nPublishing Events \"from\" Devices\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nApplications can publish events as if they originated from a Device\n\n.. code:: python\n\n myData={'name' : 'foo', 'cpu' : 60, 'mem' : 50}\n client.publishEvent(myDeviceType, myDeviceId, \"status\", myData)\n\nPublishing Commands to Devices\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nApplications can publish commands to connected Devices\n\n.. code:: python\n\n commandData={'rebootDelay' : 50}\n client.publishCommand(myDeviceType, myDeviceId, \"reboot\", myData)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ibm-messaging/iot-python", "keywords": null, "license": "Eclipse Public License - v 1.0\n\nTHE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC\nLICENSE (\"AGREEMENT\"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM\nCONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.\n\n1. DEFINITIONS\n\n\"Contribution\" means:\n\na) in the case of the initial Contributor, the initial code and documentation\n distributed under this Agreement, and\nb) in the case of each subsequent Contributor:\n i) changes to the Program, and\n ii) additions to the Program;\n\n where such changes and/or additions to the Program originate from and are\n distributed by that particular Contributor. A Contribution 'originates'\n from a Contributor if it was added to the Program by such Contributor\n itself or anyone acting on such Contributor's behalf. Contributions do not\n include additions to the Program which: (i) are separate modules of\n software distributed in conjunction with the Program under their own\n license agreement, and (ii) are not derivative works of the Program.\n\n\"Contributor\" means any person or entity that distributes the Program.\n\n\"Licensed Patents\" mean patent claims licensable by a Contributor which are\nnecessarily infringed by the use or sale of its Contribution alone or when\ncombined with the Program.\n\n\"Program\" means the Contributions distributed in accordance with this\nAgreement.\n\n\"Recipient\" means anyone who receives the Program under this Agreement,\nincluding all Contributors.\n\n2. GRANT OF RIGHTS\n a) Subject to the terms of this Agreement, each Contributor hereby grants\n Recipient a non-exclusive, worldwide, royalty-free copyright license to\n reproduce, prepare derivative works of, publicly display, publicly\n perform, distribute and sublicense the Contribution of such Contributor,\n if any, and such derivative works, in source code and object code form.\n b) Subject to the terms of this Agreement, each Contributor hereby grants\n Recipient a non-exclusive, worldwide, royalty-free patent license under\n Licensed Patents to make, use, sell, offer to sell, import and otherwise\n transfer the Contribution of such Contributor, if any, in source code and\n object code form. This patent license shall apply to the combination of\n the Contribution and the Program if, at the time the Contribution is\n added by the Contributor, such addition of the Contribution causes such\n combination to be covered by the Licensed Patents. The patent license\n shall not apply to any other combinations which include the Contribution.\n No hardware per se is licensed hereunder.\n c) Recipient understands that although each Contributor grants the licenses\n to its Contributions set forth herein, no assurances are provided by any\n Contributor that the Program does not infringe the patent or other\n intellectual property rights of any other entity. Each Contributor\n disclaims any liability to Recipient for claims brought by any other\n entity based on infringement of intellectual property rights or\n otherwise. As a condition to exercising the rights and licenses granted\n hereunder, each Recipient hereby assumes sole responsibility to secure\n any other intellectual property rights needed, if any. For example, if a\n third party patent license is required to allow Recipient to distribute\n the Program, it is Recipient's responsibility to acquire that license\n before distributing the Program.\n d) Each Contributor represents that to its knowledge it has sufficient\n copyright rights in its Contribution, if any, to grant the copyright\n license set forth in this Agreement.\n\n3. REQUIREMENTS\n\nA Contributor may choose to distribute the Program in object code form under\nits own license agreement, provided that:\n\n a) it complies with the terms and conditions of this Agreement; and\n b) its license agreement:\n i) effectively disclaims on behalf of all Contributors all warranties\n and conditions, express and implied, including warranties or\n conditions of title and non-infringement, and implied warranties or\n conditions of merchantability and fitness for a particular purpose;\n ii) effectively excludes on behalf of all Contributors all liability for\n damages, including direct, indirect, special, incidental and\n consequential damages, such as lost profits;\n iii) states that any provisions which differ from this Agreement are\n offered by that Contributor alone and not by any other party; and\n iv) states that source code for the Program is available from such\n Contributor, and informs licensees how to obtain it in a reasonable\n manner on or through a medium customarily used for software exchange.\n\nWhen the Program is made available in source code form:\n\n a) it must be made available under this Agreement; and\n b) a copy of this Agreement must be included with each copy of the Program.\n Contributors may not remove or alter any copyright notices contained\n within the Program.\n\nEach Contributor must identify itself as the originator of its Contribution,\nif\nany, in a manner that reasonably allows subsequent Recipients to identify the\noriginator of the Contribution.\n\n4. COMMERCIAL DISTRIBUTION\n\nCommercial distributors of software may accept certain responsibilities with\nrespect to end users, business partners and the like. While this license is\nintended to facilitate the commercial use of the Program, the Contributor who\nincludes the Program in a commercial product offering should do so in a manner\nwhich does not create potential liability for other Contributors. Therefore,\nif a Contributor includes the Program in a commercial product offering, such\nContributor (\"Commercial Contributor\") hereby agrees to defend and indemnify\nevery other Contributor (\"Indemnified Contributor\") against any losses,\ndamages and costs (collectively \"Losses\") arising from claims, lawsuits and\nother legal actions brought by a third party against the Indemnified\nContributor to the extent caused by the acts or omissions of such Commercial\nContributor in connection with its distribution of the Program in a commercial\nproduct offering. The obligations in this section do not apply to any claims\nor Losses relating to any actual or alleged intellectual property\ninfringement. In order to qualify, an Indemnified Contributor must:\na) promptly notify the Commercial Contributor in writing of such claim, and\nb) allow the Commercial Contributor to control, and cooperate with the\nCommercial Contributor in, the defense and any related settlement\nnegotiations. The Indemnified Contributor may participate in any such claim at\nits own expense.\n\nFor example, a Contributor might include the Program in a commercial product\noffering, Product X. That Contributor is then a Commercial Contributor. If\nthat Commercial Contributor then makes performance claims, or offers\nwarranties related to Product X, those performance claims and warranties are\nsuch Commercial Contributor's responsibility alone. Under this section, the\nCommercial Contributor would have to defend claims against the other\nContributors related to those performance claims and warranties, and if a\ncourt requires any other Contributor to pay any damages as a result, the\nCommercial Contributor must pay those damages.\n\n5. NO WARRANTY\n\nEXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR\nIMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,\nNON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each\nRecipient is solely responsible for determining the appropriateness of using\nand distributing the Program and assumes all risks associated with its\nexercise of rights under this Agreement , including but not limited to the\nrisks and costs of program errors, compliance with applicable laws, damage to\nor loss of data, programs or equipment, and unavailability or interruption of\noperations.\n\n6. DISCLAIMER OF LIABILITY\n\nEXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY\nCONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION\nLOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE\nEXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY\nOF SUCH DAMAGES.\n\n7. GENERAL\n\nIf any provision of this Agreement is invalid or unenforceable under\napplicable law, it shall not affect the validity or enforceability of the\nremainder of the terms of this Agreement, and without further action by the\nparties hereto, such provision shall be reformed to the minimum extent\nnecessary to make such provision valid and enforceable.\n\nIf Recipient institutes patent litigation against any entity (including a\ncross-claim or counterclaim in a lawsuit) alleging that the Program itself\n(excluding combinations of the Program with other software or hardware)\ninfringes such Recipient's patent(s), then such Recipient's rights granted\nunder Section 2(b) shall terminate as of the date such litigation is filed.\n\nAll Recipient's rights under this Agreement shall terminate if it fails to\ncomply with any of the material terms or conditions of this Agreement and does\nnot cure such failure in a reasonable period of time after becoming aware of\nsuch noncompliance. If all Recipient's rights under this Agreement terminate,\nRecipient agrees to cease use and distribution of the Program as soon as\nreasonably practicable. However, Recipient's obligations under this Agreement\nand any licenses granted by Recipient relating to the Program shall continue\nand survive.\n\nEveryone is permitted to copy and distribute copies of this Agreement, but in\norder to avoid inconsistency the Agreement is copyrighted and may only be\nmodified in the following manner. The Agreement Steward reserves the right to\npublish new versions (including revisions) of this Agreement from time to\ntime. No one other than the Agreement Steward has the right to modify this\nAgreement. The Eclipse Foundation is the initial Agreement Steward. The\nEclipse Foundation may assign the responsibility to serve as the Agreement\nSteward to a suitable separate entity. Each new version of the Agreement will\nbe given a distinguishing version number. The Program (including\nContributions) may always be distributed subject to the version of the\nAgreement under which it was received. In addition, after a new version of the\nAgreement is published, Contributor may elect to distribute the Program\n(including its Contributions) under the new version. Except as expressly\nstated in Sections 2(a) and 2(b) above, Recipient receives no rights or\nlicenses to the intellectual property of any Contributor under this Agreement,\nwhether expressly, by implication, estoppel or otherwise. All rights in the\nProgram not expressly granted under this Agreement are reserved.\n\nThis Agreement is governed by the laws of the State of New York and the\nintellectual property laws of the United States of America. No party to this\nAgreement will bring a legal action under this Agreement more than one year\nafter the cause of action arose. Each party waives its rights to a jury trial in\nany resulting litigation.", "maintainer": null, "maintainer_email": null, "name": "ibmiotc", "package_url": "https://pypi.org/project/ibmiotc/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ibmiotc/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ibm-messaging/iot-python" }, "release_url": "https://pypi.org/project/ibmiotc/0.0.7/", "requires_dist": null, "requires_python": null, "summary": "IBM Internet of Things Cloud for Python", "version": "0.0.7" }, "last_serial": 1240266, "releases": { "0.0.6": [ { "comment_text": "", "digests": { "md5": "6416c6cb6f941e35ef0b8d249598397b", "sha256": "fa698036932503775934b88245e5992e9a73b69a4fb49ab51b22ee6fd416a67f" }, "downloads": -1, "filename": "ibmiotc-0.0.6.zip", "has_sig": false, "md5_digest": "6416c6cb6f941e35ef0b8d249598397b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30798, "upload_time": "2014-09-27T00:43:21", "url": "https://files.pythonhosted.org/packages/21/db/5ca614d7fe7608f02ebc32f74ce8b69a01b970b924cb85bbcd33a42bd484/ibmiotc-0.0.6.zip" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "3f1916100735622bbab31d27fe6c32ad", "sha256": "b99b2caca4aaf4a4cc899292b2a19a70675a4ca674fa8754e7a672f3e9e4fa53" }, "downloads": -1, "filename": "ibmiotc-0.0.7.zip", "has_sig": false, "md5_digest": "3f1916100735622bbab31d27fe6c32ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31446, "upload_time": "2014-09-27T20:22:57", "url": "https://files.pythonhosted.org/packages/13/92/81527edd5f19978f270b3c58c669dcedba5431a7e0ba392acf05cee82284/ibmiotc-0.0.7.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3f1916100735622bbab31d27fe6c32ad", "sha256": "b99b2caca4aaf4a4cc899292b2a19a70675a4ca674fa8754e7a672f3e9e4fa53" }, "downloads": -1, "filename": "ibmiotc-0.0.7.zip", "has_sig": false, "md5_digest": "3f1916100735622bbab31d27fe6c32ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31446, "upload_time": "2014-09-27T20:22:57", "url": "https://files.pythonhosted.org/packages/13/92/81527edd5f19978f270b3c58c669dcedba5431a7e0ba392acf05cee82284/ibmiotc-0.0.7.zip" } ] }