{ "info": { "author": "Bachar Wehbi", "author_email": "bwehbi@beebotte.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "===================\r\nBeebotte Python SDK\r\n===================\r\n\r\n- overview http://beebotte.com/overview \r\n- tutorials http://beebotte.com/tutorials \r\n- apidoc http://beebotte.com/api \r\n- source https://github.com/beebotte/bbt_python \r\n\r\nBugs / Feature Requests\r\n-----------------------\r\n\r\nThink you.ve found a bug? Want to see a new feature in beebotte? Please open an\r\nissue in github. Please provide as much information as possible about the issue type and how to reproduce it.\r\n\r\n https://github.com/beebotte/bbt_python/issues\r\n\r\nInstall\r\n-------\r\n\r\nUsing pip on Linux ::\r\n\r\n pip install beebotte\r\n\r\nUsing pip on MS Windows ::\r\n\r\n python -m pip install beebotte\r\n \r\nClone the source code from github ::\r\n\r\n git clone https://github.com/beebotte/bbt_python.git\r\n \r\nUsage\r\n-----\r\nTo use the library, you need to be a registered user. If this is not the case, create your account at and note your access credentials.\r\n\r\nAs a reminder, Beebotte resource description uses a two levels hierarchy:\r\n\r\n* Channel: physical or virtual connected object (an application, an arduino, a coffee machine, etc) providing some resources\r\n* Resource: most elementary part of Beebotte, this is the actual data source (e.g. temperature from a domotics sensor)\r\n \r\nBeebotte Constructor\r\n~~~~~~~~~~~~~~~~~~~~\r\nUse your account API and secret keys to initialize Beebotte connector::\r\n\r\n from beebotte import *\r\n \r\n _accesskey = 'YOUR_API_KEY'\r\n _secretkey = 'YOUR_SECRET_KEY'\r\n _hostname = 'api.beebotte.com'\r\n bbt = BBT( _accesskey, _secretkey, hostname = _hostname)\r\n\r\n ### Alternatively you can authenticate using the channel token\r\n _token = 'YOUR_CHANNEL_TOKEN'\r\n bbt = BBT(token = _token, hostname = _hostname)\r\n\r\nReading Data\r\n~~~~~~~~~~~~\r\nYou can read data from one of your channel resources using::\r\n\r\n records = bbt.read(\"channel1\", \"resource1\", limit = 5 /* read last 5 records */)\r\n \r\nYou can read data from a public channel by specifying the channel owner::\r\n\r\n records = bbt.readPublic(\"owner\", \"channel1\", \"resource1\", 5 /* read last 5 records */)\r\n \r\nWriting Data\r\n~~~~~~~~~~~~\r\nYou can write data to a resource of one of your channels using::\r\n\r\n bbt.write(\"channel1\", \"resource1\", \"Hello World\")\r\n \r\nIf you have multiple records to write (to one or multiple resources of the same channel), you can use the `bulk write` method::\r\n\r\n bbt.writeBulk(\"channel1\", [\r\n {\"resource\": \"resource1\", \"data\": \"Hello\"},\r\n {\"resource\": \"resource2\", \"data\": \"World\"}\r\n ])\r\n\r\nPublishing Data\r\n~~~~~~~~~~~~~~~~\r\nYou can publish data to a channel resource using::\r\n\r\n bbt.publish(\"any_channel\", \"any_resource\", \"Hello Horld\")\r\n\r\nPublished data is transient. It will not saved to any database; rather, it will be delivered to active subscribers in real time. \r\nThe Publish operations do not require that the channel and resource be actually created. \r\nThey will be considered as virtual: the channel and resource exist as lng as you are publishing data to them. \r\nBy default, published data is public, publish a private message, you need to add `private-` prefix to the channel name like this::\r\n\r\n bbt.publish(\"private-any_channel\", \"any_resource\", \"Hello World\")\r\n\r\nIf you have multiple records to publish (to one or multiple resources of the same channel), you can use the `bulk publish` method::\r\n\r\n bbt.publishBulk(\"channel1\", [\r\n {\"resource\": \"resource1\", \"data\": \"Hello\"},\r\n {\"resource\": \"resource2\", \"data\": \"World\"}\r\n ])\r\n\r\nAdd Channel\r\n~~~~~~~~~~~\r\nYou can add a channel using::\r\n\r\n bbt.addChannel(\r\n \"channel1\",\r\n label = \"channel label\",\r\n description = \"channel description\",\r\n ispublic = True,\r\n resources = [{\r\n \"name\": \"res1\",\r\n \"vtype\": BBT_Types.String\r\n }, {\r\n \"name\": \"res2\",\r\n \"label\": \"resource 2\",\r\n \"vtype\": BBT_Types.String\r\n }, {\r\n \"name\": \"res3\",\r\n \"description\": \"resource 3 description\",\r\n \"vtype\": BBT_Types.Number,\r\n \"sendOnSubscribe\": True\r\n }\r\n ]\r\n )\r\n\r\nGet Channel\r\n~~~~~~~~~~~\r\nYou can get the JSON description of a channel using::\r\n\r\n channel = bbt.getChannel(\"channel1\")\r\n\r\nIf you want to get all your created channels, leave the `channel` parameter to `None`::\r\n\r\n channels = bbt.getChannel()\r\n\r\nThis will return an array of all your channels. \r\n\r\nDelete Channel\r\n~~~~~~~~~~~~~~\r\n\r\nYou can delete a channel using::\r\n\r\n bbt.deleteChannel(\"channel1\")\r\n\r\nAdd Resource\r\n~~~~~~~~~~~~\r\nYou can add a resource to a channel using::\r\n\r\n bbt.addResource(\r\n channel = \"testnamek2\",\r\n name = \"res1\",\r\n vtype = BBT_Types.Number,\r\n label = \"resource 1\",\r\n description = \"description of resource 1\",\r\n sendOnSubscribe = False\r\n )\r\n\r\nGet Resource\r\n~~~~~~~~~~~~\r\n\r\nYou can get the JSON description of a resource of a channel using::\r\n\r\n resource = bbt.getResource(\"channel1\", \"resource1\")\r\n\r\nIf you want to get all resources of a channel::\r\n\r\n resources = bbt.getResource(\"channel1\")\r\n\r\nThis will return an array of all the channel resources. \r\n\r\nDelete Resource\r\n~~~~~~~~~~~~~~~\r\n\r\nYou can delete a resource of a channel using::\r\n\r\n bbt.deleteChannel(\"channel1\", \"resource1\")\r\n\r\nChannel Token Regeneration\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nYou can regenerate a channel token using::\r\n\r\n channel = bbt.regenerateChannelToken(\"channel1\")\r\n \r\n ## New token accessible using\r\n newToken = channel.token\r\n\r\nThis operation will return the JSON description of the channel with the newly generated Token.\r\nRegenerating a channel token will invalidate the last token in use. \r\nDon't forget to update your code with the new Token after regeneration.\r\n\r\nResource Object\r\n~~~~~~~~~~~~~~~~\r\nThe library provides a Resource Class that can be used as follows::\r\n\r\n ##Create the resource object\r\n resource = Resource(bbt, \"channel1\", \"resource1\")\r\n \r\n ##Read data\r\n records = resource.read(limit = 2)\r\n \r\n ##Read the last written record\r\n record = resource.recentVal()\r\n \r\n ##Write data\r\n resource.write(\"Hello World\")\r\n \r\n ##Publish data\r\n resource.publish(\"Hola amigo\")\r\n\r\nLicense\r\n-------\r\nCopyright 2013 - 2016 Beebotte.\r\n\r\n[The MIT License](http://opensource.org/licenses/MIT)", "description_content_type": null, "docs_url": null, "download_url": "https://pypi.python.org/pypi/beebotte/", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://beebotte.com", "keywords": "beebotte,api,rest,pubsub,restful,iot,internet of things,device,realtime,connected,websockets", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "beebotte", "package_url": "https://pypi.org/project/beebotte/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/beebotte/", "project_urls": { "Download": "https://pypi.python.org/pypi/beebotte/", "Homepage": "http://beebotte.com" }, "release_url": "https://pypi.org/project/beebotte/0.5.0/", "requires_dist": null, "requires_python": null, "summary": "Python library for interfacing with Beebotte", "version": "0.5.0" }, "last_serial": 2361913, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "8b4e6781072cf21faae09bf7cf22ed9a", "sha256": "6194a79256f97f11053f495a086688e5284a4a334b49ad37b45fc2054975ef17" }, "downloads": -1, "filename": "beebotte-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8b4e6781072cf21faae09bf7cf22ed9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3658, "upload_time": "2014-05-08T15:05:57", "url": "https://files.pythonhosted.org/packages/50/20/f30736543897bb3c1443c8962680d398f6f7c31cfcdd294272c4cd87213f/beebotte-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "8bdfefde23cb3b68825d4a5849ae2305", "sha256": "1fbe2dfa29a157008da6c593a0c920d84e5c870ad37709e1bfbb3c602db3ecb7" }, "downloads": -1, "filename": "beebotte-0.1.2.zip", "has_sig": false, "md5_digest": "8bdfefde23cb3b68825d4a5849ae2305", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5927, "upload_time": "2014-05-10T21:53:00", "url": "https://files.pythonhosted.org/packages/1e/ac/bef3be8abca68980f9b135d92bae388e67984472cb67dd45449b3267141b/beebotte-0.1.2.zip" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "6c035bdfecb8d726982083772678c902", "sha256": "6007cd3ac759cb703f1bd90e5166f14fea93189301563f89175e42871d892fee" }, "downloads": -1, "filename": "beebotte-0.1.3.zip", "has_sig": false, "md5_digest": "6c035bdfecb8d726982083772678c902", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5517, "upload_time": "2014-05-10T22:24:07", "url": "https://files.pythonhosted.org/packages/5c/f7/b5678314cc063c7faa4fef3af6f4cc1a8dabd684120348bd90d759866507/beebotte-0.1.3.zip" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "4efc8d9a80e5789677b812fd2cac241e", "sha256": "66ec46474b2b13e58dfdc1f7270a12097bbd3b9a8eaaaa815ccfa7a323572947" }, "downloads": -1, "filename": "beebotte-0.1.4.zip", "has_sig": false, "md5_digest": "4efc8d9a80e5789677b812fd2cac241e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5516, "upload_time": "2014-05-10T22:25:38", "url": "https://files.pythonhosted.org/packages/c5/bc/33eb365404ce60b3ac225fd002aaf89067232cf5660f98dc8b49a3e74d5d/beebotte-0.1.4.zip" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "52f08553955a6c3b42dbe6ce2023bede", "sha256": "549d7fdda937d3d4843cf7898999d3347780e89a44e0719af65a3b59fa65a4af" }, "downloads": -1, "filename": "beebotte-0.2.1.tar.gz", "has_sig": false, "md5_digest": "52f08553955a6c3b42dbe6ce2023bede", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5092, "upload_time": "2014-08-02T00:56:34", "url": "https://files.pythonhosted.org/packages/b6/8d/0853b077732b8b8c39b122b084656666067283d5b34bbbd2df3aa16beb9c/beebotte-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "ff9e199ab363baaec601f7b436018e75", "sha256": "f648eb174477d4448427887192d2510fc01b69d1b6bbcaa204df0023827a8e9b" }, "downloads": -1, "filename": "beebotte-0.2.2.tar.gz", "has_sig": false, "md5_digest": "ff9e199ab363baaec601f7b436018e75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5105, "upload_time": "2014-10-07T21:28:31", "url": "https://files.pythonhosted.org/packages/f2/29/863ffe454fcf8695935854616ccc845a1821f743317fd56bc97e47fdccdb/beebotte-0.2.2.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "2d64ea5056af2bdaa170c092021bcbd4", "sha256": "9bb1ed67bc2550fd85d0713d2c6c7e4119444e3ddfbf02b58960931592726416" }, "downloads": -1, "filename": "beebotte-0.3.0.tar.gz", "has_sig": false, "md5_digest": "2d64ea5056af2bdaa170c092021bcbd4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5296, "upload_time": "2014-12-16T23:16:13", "url": "https://files.pythonhosted.org/packages/3a/d2/504abed5b61677910e0b7c6d3fec026f396fa2b9c933f2c4e26259bba6a5/beebotte-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "070546c5cad4d597ff58cf428495b94a", "sha256": "33cc118b43203d8da344d3eeead626a8e8c5d2ef82da45fb522b448d485c8d75" }, "downloads": -1, "filename": "beebotte-0.3.1.tar.gz", "has_sig": false, "md5_digest": "070546c5cad4d597ff58cf428495b94a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5347, "upload_time": "2015-01-18T22:30:17", "url": "https://files.pythonhosted.org/packages/40/a6/0b8afec851518e24bf47d6ab6df2dadd47446769db5509b2039566d65082/beebotte-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "bcab9f874ccf01637f9ad4461bfbc19c", "sha256": "c5dbc2ab6759c47be1bc9037918fdfab00b2d72d1e64d90bdf704fd8a85a44e6" }, "downloads": -1, "filename": "beebotte-0.4.0.tar.gz", "has_sig": false, "md5_digest": "bcab9f874ccf01637f9ad4461bfbc19c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6275, "upload_time": "2015-06-29T10:00:08", "url": "https://files.pythonhosted.org/packages/52/66/7cad344b7226bc2119a4db142bf3edf73c34ffe84c0e9f20dd40688b3e18/beebotte-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "04c1797a2505ba3c4fbadb8e13a4d915", "sha256": "92549a0cf6146a38b038e433dadd93a20fe97f1dcf8ceb5ea59f7fe03de2617d" }, "downloads": -1, "filename": "beebotte-0.5.0.tar.gz", "has_sig": false, "md5_digest": "04c1797a2505ba3c4fbadb8e13a4d915", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6935, "upload_time": "2016-09-24T23:56:11", "url": "https://files.pythonhosted.org/packages/04/18/cf7f3eb36ed7f8050fafe02952f1f63efa08d0ead5721229be103cbf418b/beebotte-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "04c1797a2505ba3c4fbadb8e13a4d915", "sha256": "92549a0cf6146a38b038e433dadd93a20fe97f1dcf8ceb5ea59f7fe03de2617d" }, "downloads": -1, "filename": "beebotte-0.5.0.tar.gz", "has_sig": false, "md5_digest": "04c1797a2505ba3c4fbadb8e13a4d915", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6935, "upload_time": "2016-09-24T23:56:11", "url": "https://files.pythonhosted.org/packages/04/18/cf7f3eb36ed7f8050fafe02952f1f63efa08d0ead5721229be103cbf418b/beebotte-0.5.0.tar.gz" } ] }