tuya-connector-python
The tuya-connector-python SDK is designed to support openAPIs and Pulsar messages provided by Tuya. Before using this SDK, you can see Quick Start on the Tuya Developer website to learn more about Cloud Development Platform.
Install
pip3 install tuya-connector-python
Get started
-
Sign up for Tuya developer account.
-
Create a cloud project. See the tutorial for how to get the authorization key and other necessary parameters.
-
A quick example is as follows:
from tuya_connector import ( TuyaOpenAPI, TuyaOpenPulsar, TuyaCloudPulsarTopic, ) ACCESS_ID = "your-access-id" ACCESS_KEY = "your-access-key" API_ENDPOINT = "https://openapi.tuyacn.com" MQ_ENDPOINT = "wss://mqe.tuyacn.com:8285/" # Init OpenAPI and connect openapi = TuyaOpenAPI(API_ENDPOINT, ACCESS_ID, ACCESS_KEY) openapi.connect() # Call any API from Tuya response = openapi.get("/v1.0/statistics-datas-survey", dict()) # Init Message Queue open_pulsar = TuyaOpenPulsar( ACCESS_ID, ACCESS_KEY, MQ_ENDPOINT, TuyaCloudPulsarTopic.PROD ) # Add Message Queue listener open_pulsar.add_message_listener(lambda msg: print(f"---\nexample receive: {msg}")) # Start Message Queue open_pulsar.start() input() # Stop Message Queue open_pulsar.stop()
OpenAPI reference
Tuya 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 to create IoT applications.
Feedback
If you have any questions, please provide feedback via Github Issue or Technical Ticket.
License
The tuya-connector-python SDK is available under the MIT license. For more information, see the LICENSE file.
Metadata
Release files for tuya-connector-python 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tuya-connector-python-0.1.2.tar.gz | 9.1 kB | Without provenance | Details for tuya-connector-python-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tuya_connector_python-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for tuya_connector_python-0.1.2-py3-none-any.whl |
Total release size: 19.0 kB
Release files / tuya-connector-python-0.1.2.tar.gz
| Download URL | tuya-connector-python-0.1.2.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84a8fa9b22d839e8ff0c3a45b36df6194b3dfb1b2dd31b9203eb7f94e3303d7e
|
|
BLAKE2b-256 checksum How to use checksums |
3e3cd3d750fc81a87aaec9082b13fe270e5e6ff9b3432791989042d46b251447
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.6
|
Release files / tuya_connector_python-0.1.2-py3-none-any.whl
| Download URL | tuya_connector_python-0.1.2-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
42cde44cf9af86d187f89b2f0c121a1104a0c7b7ca16bc46bbc6b470d299afdf
|
|
BLAKE2b-256 checksum How to use checksums |
6bf927a340f4472f6ada8da4ef30178cd32a55775ce6ada55ca4aa901652477d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.6
|
Security for tuya-connector-python 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.