{"id":27481,"library":"tuya-device-sharing-sdk","title":"Tuya Device Sharing SDK","description":"A Python SDK for Tuya Open API that provides IoT capabilities for device sharing, user management, and IoT core operations. Current version: 0.2.9. Maintained by Tuya official, with monthly releases.","status":"active","version":"0.2.9","language":"python","source_language":"en","source_url":"https://github.com/tuya/tuya-device-sharing-sdk","tags":["tuya","iot","device-sharing","smart-home","api-sdk"],"install":[{"cmd":"pip install tuya-device-sharing-sdk","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"wrong":"from tuya_connector import TuyaOpenAPI","symbol":"TuyaOpenAPI","correct":"from tuya_sharing import TuyaOpenAPI"}],"quickstart":{"code":"import os\nfrom tuya_connector import TuyaOpenAPI\n\nACCESS_ID = os.environ.get('TUYA_ACCESS_ID', '')\nACCESS_KEY = os.environ.get('TUYA_ACCESS_KEY', '')\nAPI_ENDPOINT = 'https://openapi.tuyaus.com'\n\nopenapi = TuyaOpenAPI(API_ENDPOINT, ACCESS_ID, ACCESS_KEY)\nopenapi.connect()\nprint('Connected' if openapi.token else 'Connection failed')","lang":"python","description":"Initialize TuyaOpenAPI with credentials from environment variables and test connection."},"warnings":[{"fix":"Use 'from tuya_connector import TuyaOpenAPI' instead of 'from tuya_device_sharing_sdk import ...'","message":"The package provides a 'tuya_connector' module, not a top-level 'tuya_device_sharing_sdk' module. Import from tuya_connector.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure API_ENDPOINT is set to the correct regional endpoint.","message":"API endpoint must match the region of your Tuya IoT account. Common endpoints: https://openapi.tuyaus.com (US), https://openapi.tuyacn.com (China), https://openapi.tuyaeu.com (Europe).","severity":"gotcha","affected_versions":"all"},{"fix":"Change imports to use 'from tuya_connector import ...'","message":"The older pattern of importing from 'tuya_device_sharing_sdk' directly is deprecated. Only import from 'tuya_connector' is supported in v0.2.x.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Check token expiry and call openapi.connect() again if needed.","message":"Token expiration is not automatically refreshed in the SDK. You must handle token refresh logic yourself or re-connect on 401 errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.2.9':27 'api':11,44 'api-sdk':43 'capabl':15 'core':23 'current':25 'devic':2,17,38 'device-shar':37 'home':42 'iot':14,22,36 'maintain':28 'manag':20 'month':33 'offici':31 'open':10 'oper':24 'provid':13 'python':6 'releas':34 'sdk':4,7,45 'share':3,18,39 'smart':41 'smart-hom':40 'tuya':1,9,30,35 'user':19 'version':26","created_at":"2026-05-01T17:46:28.995336+00:00","updated_at":"2026-05-01T17:46:28.995336+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmpcq2j0jad/venv/lib/python3.12/site-packages/tuya_sharing/__init__.py\", line 2, in <module>\n    from .manager import Manager, SharingDeviceListener\n  File \"/tmp/tmpcq2j0jad/venv/lib/python3.12/site-packages/tuya_"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://developer.tuya.com","github":"https://github.com/tuya/tuya-device-sharing-sdk","docs":null,"changelog":"https://github.com/tuya/tuya-device-sharing-sdk/wiki/Tuya-Device-Sharing-SDK-Release-Notes","pypi":"https://pypi.org/project/tuya-device-sharing-sdk/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["aws","http-networking","devops","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}