Registry / aws / tencentcloud-sdk-python-tbaas

tencentcloud-sdk-python-tbaas

JSON →
library3.0.1459pypypi✓ verified 88d ago

Official Tencent Cloud SDK for Python, specifically for the TBaaS (Tencent Blockchain as a Service) product. Current version is 3.0.1459. Released irregularly alongside other Tencent Cloud SDK packages.

pip install tencentcloud-sdk-python-tbaas
INSTALL
IMPORT
SIG · TENCENTCLOUD-SDK-P
T
tencentcloud-sdk-python-tbaas
awspythonv3.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.

TbaasClient
✓ from tencentcloud.tbaas.v20180416 import tbaas_client
✗ from tbaas import TbaasClient
Correct package path includes versioned API module

Initialize client with credentials and call a TBaaS API.

import os from tencentcloud.common import credential from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException from tencentcloud.tbaas.v20180416 import tbaas_client, models try: cred = credential.Credential( os.environ.get("TENCENTCLOUD_SECRET_ID", ""), os.environ.get("TENCENTCLOUD_SECRET_KEY", "") ) client = tbaas_client.TbaasClient(cred, "ap-guangzhou") req = models.DescribeFabricBlockRequest() req.BlockNumber = 0 req.ChannelId = "mychannel" resp = client.DescribeFabricBlock(req) print(resp.to_json_string()) except TencentCloudSDKException as err: print(err)
Debug
Known issues
breakingThe old SDK (v2.x) used a different import structure (e.g., `from tencentcloud.tbaas.v20180416 import tbaas_client` vs `from tencentcloud.tbaas.v20180416.models import ...`). In v3, model classes must be imported from `models` submodule.
fix
Update imports: `from tencentcloud.tbaas.v20180416 import models` and use `models.DescribeFabricBlockRequest()`.
affects: <3.0.0
gotchaAll API operations require a correct region parameter. TBaaS supports limited regions (e.g., ap-guangzhou, ap-beijing). Using an unsupported region will cause a 'RegionUnavailable' error.
fix
Check available regions for TBaaS in Tencent Cloud documentation and specify a valid region when creating the client.
affects: all
gotchaThe `ChannelId` and `BlockNumber` parameters must exactly match the blockchain network configuration. For example, channel names are case-sensitive.
fix
Verify the exact channel ID and block number from your TBaaS console or network config.
affects: all
deprecatedSome older TBaaS API actions (like `InvokeChainMakerContract`) are deprecated in favor of newer Fabric-specific methods. Using deprecated endpoints may stop working without notice.
fix
Check the latest API documentation and migrate to supported actions like `DescribeFabricBlock` or `InvokeFabricContract`.
affects: >=3.0.0
Errors
Common errors & fixes
tencentcloud.common.exception.tencent_cloud_sdk_exception.TencentCloudSDKException: [TencentCloudSDKException] code: UnauthorizedOperation, message: You are not authorized to perform this action
Missing or invalid SecretId/SecretKey, or the account does not have permission for TBaaS operations.
fix
Ensure TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY environment variables are set correctly, and that the account has been granted TBaaS access via CAM.
ModuleNotFoundError: No module named 'tencentcloud'
Missing required common package.
fix
Run: pip install tencentcloud-sdk-python-common
tencentcloud.common.exception.tencent_cloud_sdk_exception.TencentCloudSDKException: code: InvalidParameter, message: Parameter [ChannelId] is invalid
The channel name does not exist or is misspelled.
fix
Verify the exact channel ID from the TBaaS console. Note that channel names are case-sensitive.
AttributeError: module 'tencentcloud.tbaas.v20180416' has no attribute 'tbaas_client'
Attempted to import from wrong path (e.g., using `from tencentcloud.tbaas import tbaas_client`).
fix
Use correct import: `from tencentcloud.tbaas.v20180416 import tbaas_client`
Upgrade
Version history
3.0.1459latest on PyPI · released Sep 15, 2025
Audit
Dependencies
tencentcloud-sdk-python-commonrequiredRequired for all API calls (client, credentials, exceptions)
requestsrequiredUnderlying HTTP library for API requests
Agent activity
33 hits · last 30 days
node
30
Resources