{"id":19226910,"url":"https://github.com/mehuaniket/iotcommute","last_synced_at":"2026-06-23T10:32:23.565Z","repository":{"id":181762900,"uuid":"84788705","full_name":"mehuaniket/iotcommute","owner":"mehuaniket","description":"library for IOT communicate","archived":false,"fork":false,"pushed_at":"2017-05-08T09:06:44.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T10:26:51.717Z","etag":null,"topics":["iot-commute","iot-device","library","python","websockets"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mehuaniket.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-03-13T05:49:10.000Z","updated_at":"2023-08-25T11:30:05.000Z","dependencies_parsed_at":"2023-07-17T06:59:59.945Z","dependency_job_id":null,"html_url":"https://github.com/mehuaniket/iotcommute","commit_stats":null,"previous_names":["mehuaniket/iotcommute"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mehuaniket/iotcommute","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehuaniket%2Fiotcommute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehuaniket%2Fiotcommute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehuaniket%2Fiotcommute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehuaniket%2Fiotcommute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehuaniket","download_url":"https://codeload.github.com/mehuaniket/iotcommute/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehuaniket%2Fiotcommute/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34686725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["iot-commute","iot-device","library","python","websockets"],"created_at":"2024-11-09T15:20:52.232Z","updated_at":"2026-06-23T10:32:23.546Z","avatar_url":"https://github.com/mehuaniket.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IOT commute client for Python\n--------------------------------\n[![Build Status](https://travis-ci.org/kodani/iotcommute.svg?branch=master)](https://travis-ci.org/kodani/iotcommute)\nAniket Patel (c) 2017\nLicense\n-------\niot commute Python library is licensed under the MIT License\n\nDesign\n------\nAs project statment we are are building library that could work with `IOT \ncommunicate` project with simplicity.\nBasic idea is revolving around Handling client side web-socket connection without\ninvolving user. So he\\she could simply intialise connection with just `device-key` \nand `device-id`.After only concern for user is to set funtion on event that callback \nlibrary.\nfollowing is basic architecture diagram we're dealing with.\n```\n                              |---------|\n                              | server  |\n                              |---------|\n                                  ||\n                                  ||\n                           |----------------|\n                           |tailable cursors|\n                           |----------------|\n                                  ||\n                                  ||\n                           |----------------|\n                           | websocket      |\n                           |----------------|\n                                  ||\n                                  ||\n                           |-----------------|\n                           |   iotcommute lib|\n                           |-----------------|\n                                  ||\n                                  ||\n                                callbacks\n                            |---------------|\n                            |client function|\n                            |---------------|\n                                          \n```\nThe library\n-----------\n\n  Iot commute is a set of REST-like APIs  with web socket that expose\nmany capabilities required to build a application that requires\nto pass mesage beetween iot device to client device and client device\nt iot device.Execute functions on real time events of iot device\n,passing small payloads and data(thorough WebSockets), and more, with the simple web-\nsocket connection and this all will handle by the iot commute library\nThis module provides an easy to use abstraction over the direct web-socket connection\nwith server.\nThe calls have been converted to methods and their JSON responses\nare returned as native Python structures, for example, dicts, lists, bools etc.\nSee the **[IOT commute documentation](URL)**\nfor the complete list of events and features, supported parameters and values,\nand response formats.\n\nGetting started\n---------------\n```\n    #!python\n    from iotcommute import WebSocket\n    # Initialise.\n    iws = WebSocket(\"L1SEIUDU1MC996W48L8Q\", \"FY6ODPIVU522SY1\",\"device\")\n    # Callback for tick reception.\n\n    def on_tick(tick, ws):\n        print(tick)\n        # Callback for successful connection.\n\n    def on_connect(ws):\n        print(\"connection is established\")\n    iws.on_tick = on_tick\n    iws.on_connect = on_connect\n    # Infinite loop on the main thread. Nothing after this will run.\n    # You have to use the pre-defined callbacks to manage\n    # subscriptions.\n    iws.connect()\n```\nA typical web application\n-------------------------\nIn a typical web application where a new instance of\nviews, controllers etc. are created per incoming HTTP\nrequest, you will need to initialise a new instance of\nIOTcommunicate client per request as well. This is because each\nindividual instance represents a single device that's\nauthenticated, unlike an **admin** API where you may\nuse one instance to manage many users.\nHence, in this client application, typically:\n- You will initialise an instance of the IotCommute client\n- NOTICE:Redirect the user to the `login_url()`\n   also for now you directly initialize websocket with genrated keys\n-  At the redirect url endpoint, obtain the\n`request_token` from the query parameters\n-  for now you just pass the tokens and create connection,\n   start to communicate.\n\nExceptions\n----------\nIotCommute client saves you the hassle of detecting API errors\nby looking at codes or JSON error responses. Instead,\nit raises aptly named **[exceptions]** that you can catch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehuaniket%2Fiotcommute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehuaniket%2Fiotcommute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehuaniket%2Fiotcommute/lists"}