Registry / aws / tencentcloud-sdk-python-cdn

tencentcloud-sdk-python-cdn

JSON →
library3.1.89pypypi✓ verified 84d ago

Official Tencent Cloud SDK for the Content Delivery Network (CDN) service. Version 3.1.89. Monthly release cadence closely following the SDK generator.

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

CdnClient
from tencentcloud.cdn.v20180606 import cdn_client
from tencentcloud.cdn import CdnClient
The top-level package does not contain the client class directly. Must import from the versioned module.

Standard quickstart using environment variables for credentials and calling DescribeCdnData.

import os from tencentcloud.common import credential from tencentcloud.cdn.v20180606 import cdn_client, models cred = credential.Credential( os.environ.get('TENCENTCLOUD_SECRET_ID', ''), os.environ.get('TENCENTCLOUD_SECRET_KEY', '') ) client = cdn_client.CdnClient(cred, "ap-guangzhou") req = models.DescribeCdnDataRequest() req.Metric = "flux" req.Domain = "example.com" req.StartTime = "2023-01-01 00:00:00" req.EndTime = "2023-01-02 00:00:00" resp = client.DescribeCdnData(req) print(resp)
Debug
Known issues
breakingIn version 3.0.x and earlier, SDK was installed as a monolithic 'tencentcloud-sdk-python' package. Now each service is a separate package. Ensure you install the correct specific package for CDN.
fix
Uninstall the old package (pip uninstall tencentcloud-sdk-python) and install per-service package: pip install tencentcloud-sdk-python-cdn.
affects: >=3.0.0
gotchaThe client constructor requires a region (e.g., 'ap-guangzhou') as second argument, even for global services like CDN. Using an empty string may lead to unexpected behavior.
fix
Always specify a valid region string, typically 'ap-guangzhou' for CDN.
affects: all
deprecatedThe older authentication method using SecretId/SecretKey directly in code is discouraged. Use environment variables or Tencent Cloud CAM roles.
fix
Use Credential constructor with environment variables or assume-role.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tencentcloud'
Missing base tencentcloud-sdk-python package or the specific CDN package.
fix
Run 'pip install tencentcloud-sdk-python-cdn'. This installs the common dependency automatically.
AttributeError: module 'tencentcloud' has no attribute 'cdn'
Attempting to import from 'tencentcloud.cdn' directly without specifying versioned module.
fix
Use the correct import: from tencentcloud.cdn.v20180606 import cdn_client
tencentcloud.common.exception.TencentCloudSDKException: Failed to parse SSEResponse
Incorrect request parameters or malformed JSON. Often due to missing required fields like 'Domain' or wrong date format.
fix
Verify request model fields using the API documentation. Use the correct model class from models module.
Upgrade
Version history
3.1.89latest on PyPI · released Apr 29, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
16 hits · last 30 days
node
14
Resources
tencentcloud-sdk-python-cdn — pip install tencentcloud-sdk-python-cdn · libregistry