Metadata-Version: 2.1
Name: tuya-connector-python
Version: 0.1.1
Summary: The `tuya-connector-python` SDK is desinged to support open APIs and Pulsar Messages provided by Tuya.
Home-page: https://github.com/tuya/tuya-connector-python
Author: Tuya Inc.
Author-email: developer@tuya.com
License: MIT
Project-URL: Bug Tracker, https://github.com/tuya/tuya-connector-python/issues
Project-URL: Changes, https://github.com/tuya/tuya-connector-python/wiki/Tuya-Connector-Python-Release-Notes
Keywords: tuya iot cloud sdk python
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.0
Description-Content-Type: text/markdown
Requires-Dist: requests
Requires-Dist: pycryptodome
Requires-Dist: websocket-client
Provides-Extra: test

# tuya-connector-python

The `tuya-connector-python` SDK is desinged to support open APIs and Pulsar Messages provided by Tuya. Before using, you can read more about cloud project configuration by accessing [official tutorial](https://developer.tuya.com/en/docs/iot/device-control-practice?id=Kat1jdeul4uf8).

Quick Example:

``` python
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()

```

