Registry / gcp / tencentcloud-sdk-python-tsw

tencentcloud-sdk-python-tsw

JSON →
library3.0.1459pypypi✓ verified 87d ago

Tencent Cloud Tsw (Tencent Service Weaver) SDK for Python, part of the official Tencent Cloud SDK. Version 3.0.1459. Released as part of the tencentcloud-sdk-python family; follows the same release cadence as the parent SDK.

pip install tencentcloud-sdk-python-tsw
INSTALL
IMPORT
SIG · TENCENTCLOUD-SDK-P
T
tencentcloud-sdk-python-tsw
gcppythonv3.0.1459
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TswClient
✓ from tencentcloud.tsw.v20200924 import tsw_client
✗ from tencentcloud.tsw import TswClient
Import must specify the API version (v20200924) and use the module tsw_client
models
✓ from tencentcloud.tsw.v20200924 import models
✗ import models
The models module is version-specific and must be imported from the correct API version subpackage

Initialize the TswClient and make a sample API call. Replace region and request as needed.

import os from tencentcloud.common import credential from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException from tencentcloud.tsw.v20200924 import tsw_client, models try: cred = credential.Credential( os.environ.get('TENCENTCLOUD_SECRET_ID', ''), os.environ.get('TENCENTCLOUD_SECRET_KEY', '') ) client = tsw_client.TswClient(cred, 'ap-guangzhou') req = models.DescribeComponentAlertObjectRequest() resp = client.DescribeComponentAlertObject(req) print(resp.to_json_string()) except TencentCloudSDKException as err: print(err)
Debug
Known issues
gotchaThe TswClient constructor expects a 'region' parameter; omitting it will cause silent failures or use a default region not suitable for Tsw.
fix
Always pass the region string, e.g., 'ap-guangzhou', to the TswClient constructor.
affects: all
deprecatedOlder imports without version (e.g., from tencentcloud.tsw import tsw_client) are deprecated and may be removed in future releases.
fix
Use the full versioned import path: tencentcloud.tsw.v20200924
affects: <3.0.1000
gotchaThe API version '20200924' is the only version available; using a different version string will result in ModuleNotFoundError.
fix
Always use 'v20200924' when importing Tsw modules.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tencentcloud.tsw'
The tencentcloud-sdk-python-tsw package is not installed or the import path is incorrect.
fix
Run 'pip install tencentcloud-sdk-python-tsw' and import using 'from tencentcloud.tsw.v20200924 import tsw_client'.
AttributeError: module 'tencentcloud.tsw.v20200924' has no attribute 'TswClient'
Direct import of class name without using the correct module (tsw_client).
fix
Use 'from tencentcloud.tsw.v20200924 import tsw_client' and then tsw_client.TswClient().
Upgrade
Version history
3.0.1459latest on PyPI · released Sep 15, 2025
Audit
Dependencies
tencentcloud-sdk-python-commonrequiredRequired for credential handling and API client base classes
Agent activity
32 hits · last 30 days
node
28
OpenAI (training)
1
Resources