Tencent Cloud Domain SDK for Python

raw JSON →
3.1.65 verified Sat May 09 auth: no python

Official Tencent Cloud SDK for managing Domain services (e.g., domain registration, DNS management). Version 3.1.65. Release cadence is irregular, often bundled with other tencentcloud-sdk-python packages.

pip install tencentcloud-sdk-python-domain
error ModuleNotFoundError: No module named 'tencentcloud.domain'
cause The wrong package installed; users often install only `tencentcloud-sdk-python` (meta) or forget the domain-specific package.
fix
Install the correct package: pip install tencentcloud-sdk-python-domain
error AttributeError: module 'tencentcloud.domain.v20180808' has no attribute 'domain_client'
cause Importing the version module directly instead of importing the domain_client submodule.
fix
Use from tencentcloud.domain.v20180808 import domain_client
error tencentcloud.common.exception.TencentCloudSDKException: InvalidParameter
cause Missing or incorrect request parameters (e.g., required fields not set).
fix
Refer to the official API documentation for the correct request structure, and set all required fields via the model object.
breaking In version 3.x, the import paths changed from `tencentcloud.domain.v20180808` (no 'domain' after 'tencentcloud'). Older versions used `tencentcloud.domain.v20180808.domain_client`. The module name is now `domain_client` but it is inside the version package.
fix Use `from tencentcloud.domain.v20180808 import domain_client` instead of `from tencentcloud.domain.v20180808.domain_client import DomainClient`.
gotcha The API version ('v20180808') must match the service version. Using an incorrect version will cause import errors or unexpected behavior.
fix Always check the official API documentation for the correct version string (currently v20180808).
gotcha This package only contains the Domain service. It requires `tencentcloud-sdk-python-common` to be installed separately.
fix Install `tencentcloud-sdk-python-common` or use `tencentcloud-sdk-python` (meta-package) to include all services.

Initialize client and list domain names. Requires valid credentials in environment variables.

import os
from tencentcloud.common import credential
from tencentcloud.domain.v20180808 import domain_client, models

cred = credential.Credential(
    os.environ.get('TENCENTCLOUD_SECRET_ID', ''),
    os.environ.get('TENCENTCLOUD_SECRET_KEY', '')
)
client = domain_client.DomainClient(cred, "ap-guangzhou")
req = models.DescribeDomainNameListRequest()
resp = client.DescribeDomainNameList(req)
print(resp)