{"id":19858273,"url":"https://github.com/tuya/tuya-connector-python","last_synced_at":"2025-08-17T13:04:59.149Z","repository":{"id":45206755,"uuid":"397505411","full_name":"tuya/tuya-connector-python","owner":"tuya","description":"The tuya-connector-python SDK is designed to support open APIs and Pulsar messages provided by Tuya.","archived":false,"fork":false,"pushed_at":"2024-07-26T14:25:52.000Z","size":30,"stargazers_count":36,"open_issues_count":5,"forks_count":17,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-01-12T16:06:08.112Z","etag":null,"topics":["iot","python","tuya"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tuya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-18T07:04:23.000Z","updated_at":"2025-01-08T05:50:22.000Z","dependencies_parsed_at":"2024-11-12T14:23:06.819Z","dependency_job_id":"109da283-77cc-45ea-863a-3882d211f220","html_url":"https://github.com/tuya/tuya-connector-python","commit_stats":{"total_commits":14,"total_committers":6,"mean_commits":"2.3333333333333335","dds":0.5714285714285714,"last_synced_commit":"82487205a2c5fb8b33eb2515c7395e8ab8b148e3"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuya%2Ftuya-connector-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuya%2Ftuya-connector-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuya%2Ftuya-connector-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuya%2Ftuya-connector-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuya","download_url":"https://codeload.github.com/tuya/tuya-connector-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234705919,"owners_count":18874428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","python","tuya"],"created_at":"2024-11-12T14:22:38.005Z","updated_at":"2025-01-19T22:11:37.289Z","avatar_url":"https://github.com/tuya.png","language":"Python","readme":"# tuya-connector-python\n\n![PyPI](https://img.shields.io/pypi/v/tuya-connector-python)\n\n![PyPI - Downloads](https://img.shields.io/pypi/dm/tuya-connector-python)\n\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tuya-connector-python)\n\nThe `tuya-connector-python` SDK is designed to support openAPIs and Pulsar messages provided by Tuya. Before using this SDK, you can see [Quick Start](https://developer.tuya.com/en/docs/iot/quick-start1?id=K95ztz9u9t89n) on the Tuya Developer website to learn more about Cloud Development Platform.\n\n## Install\n\n`pip3 install tuya-connector-python`\n\n## Get started\n\n1. [Sign up](https://auth.tuya.com/register?from=https%3A%2F%2Fiot.tuya.com%2F) for Tuya developer account.\n\n2. [Create a cloud project](https://iot.tuya.com/cloud/). See the [tutorial](https://developer.tuya.com/en/docs/iot/device-control-practice?id=Kat1jdeul4uf8) for how to get the authorization key and other necessary parameters.\n\n3. A quick example is as follows:\n\n   ``` python\n   from tuya_connector import (\n   \tTuyaOpenAPI,\n   \tTuyaOpenPulsar,\n   \tTuyaCloudPulsarTopic,\n   )\n   \n   ACCESS_ID = \"your-access-id\"\n   ACCESS_KEY = \"your-access-key\"\n   API_ENDPOINT = \"https://openapi.tuyacn.com\"\n   MQ_ENDPOINT = \"wss://mqe.tuyacn.com:8285/\"\n   \n   # Init OpenAPI and connect\n   openapi = TuyaOpenAPI(API_ENDPOINT, ACCESS_ID, ACCESS_KEY)\n   openapi.connect()\n   \n   # Call any API from Tuya\n   response = openapi.get(\"/v1.0/statistics-datas-survey\", dict())\n   \n   # Init Message Queue\n   open_pulsar = TuyaOpenPulsar(\n   \tACCESS_ID, ACCESS_KEY, MQ_ENDPOINT, TuyaCloudPulsarTopic.PROD\n   )\n   # Add Message Queue listener\n   open_pulsar.add_message_listener(lambda msg: print(f\"---\\nexample receive: {msg}\"))\n   \n   # Start Message Queue\n   open_pulsar.start()\n   \n   input()\n   # Stop Message Queue\n   open_pulsar.stop()\n   ```\n\n## OpenAPI reference\n\nTuya opens up a variety of APIs covering scenarios such as device pairing, asset management, and device control. You can call APIs according to [API reference](https://developer.tuya.com/en/docs/cloud/?_source=github) to create IoT applications.\n\n## Feedback\n\nIf you have any questions, please provide feedback via **Github Issue** or [Technical Ticket](https://service.console.tuya.com/).\n\n## License\n\nThe `tuya-connector-python` SDK is available under the MIT license. For more information, see the [LICENSE](./LICENSE) file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuya%2Ftuya-connector-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuya%2Ftuya-connector-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuya%2Ftuya-connector-python/lists"}