Registry / type-stubs / tencentcloud-sdk-python-tag

tencentcloud-sdk-python-tag

JSON →
library3.1.53pypypi✓ verified 84d ago

Official Tencent Cloud SDK for managing Tag (Resource Tagging) services. Supports listing tags, creating/updating/deleting tag-key and tag-value pairs, and managing resource tags. Current version is 3.1.53, released Jan 2025. Follows monthly release cadence with the broader tencentcloud-sdk-python.

pip install tencentcloud-sdk-python-tag
INSTALL
IMPORT
SIG · TENCENTCLOUD-SDK-P
T
tencentcloud-sdk-python-tag
type-stubspythonv3.1.53
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.

TagClient
from tencentcloud.tag.v20180813 import tag_client, models
from tencentcloud.tag.v20180813.tag_client import TagClient
The correct import uses the module and then accesses TagClient via tag_client.TagClient or import the module and instantiate. Direct import of TagClient fails.
models
from tencentcloud.tag.v20180813 import models
from tencentcloud.tag.v20180813.models import *
Importing * pollutes namespace; use explicit imports or import models module and access classes.

Initialize client and list tags.

from tencentcloud.common import credential from tencentcloud.tag.v20180813 import tag_client, models # Replace with your credentials cred = credential.Credential( secret_id=os.environ.get('TENCENTCLOUD_SECRET_ID', ''), secret_key=os.environ.get('TENCENTCLOUD_SECRET_KEY', '') ) client = tag_client.TagClient(cred, 'ap-guangzhou') # Describe tags req = models.DescribeTagsRequest() resp = client.DescribeTags(req) print(resp.total_count)
Debug
Known issues
breakingIn version 3.x, the SDK replaced old credential patterns. Use `tencentcloud.common.credential.Credential` instead of legacy `SecretId`/`SecretKey` dicts. Old patterns may raise AttributeError.
fix
Import Credential from tencentcloud.common.credential and instantiate with secret_id and secret_key.
affects: >=3.0.0
gotchaThe client instance is `tag_client.TagClient`, not `TagClient` directly. Many users incorrectly try `from tencentcloud.tag.v20180813.tag_client import TagClient` which fails because TagClient is defined inside the module, not exported at the top level.
fix
Use `from tencentcloud.tag.v20180813 import tag_client` and then `tag_client.TagClient(...)`.
affects: all
gotchaAPI request objects are in `models` module. For example, `DescribeTagsRequest` must be imported from `tencentcloud.tag.v20180813.models` (or accessed as `models.DescribeTagsRequest`).
fix
Import models: `from tencentcloud.tag.v20180813 import models`, then create requests with `req = models.DescribeTagsRequest()`.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tencentcloud'
Missing base tencentcloud-sdk-python package (common) or not installed.
fix
Run `pip install tencentcloud-sdk-python-common` or `pip install tencentcloud-sdk-python-tag` which pulls it automatically.
AttributeError: module 'tencentcloud.tag.v20180813.tag_client' has no attribute 'TagClient'
Incorrect import path; tried direct import of TagClient instead of the module.
fix
Use `from tencentcloud.tag.v20180813 import tag_client` and then `tag_client.TagClient(...)`.
Upgrade
Version history
3.1.53latest on PyPI · released Mar 10, 2026
Audit
Dependencies
tencentcloud-sdk-python-commonrequiredCommon module with credential and HTTP client
Agent activity
23 hits · last 30 days
node
20
OpenAI (training)
1
Resources
tencentcloud-sdk-python-tag — pip install tencentcloud-sdk-python-tag · libregistry