{"id":28360,"library":"tencentcloud-sdk-python-tag","title":"Tencent Cloud Tag SDK for Python","description":"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.","status":"active","version":"3.1.53","language":"python","source_language":"en","source_url":"https://github.com/TencentCloud/tencentcloud-sdk-python","tags":["tencent","cloud","tag","sdk","resource-tagging"],"install":[{"cmd":"pip install tencentcloud-sdk-python-tag","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Common module with credential and HTTP client","package":"tencentcloud-sdk-python-common","optional":false}],"imports":[{"note":"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.","wrong":"from tencentcloud.tag.v20180813.tag_client import TagClient","symbol":"TagClient","correct":"from tencentcloud.tag.v20180813 import tag_client, models"},{"note":"Importing * pollutes namespace; use explicit imports or import models module and access classes.","wrong":"from tencentcloud.tag.v20180813.models import *","symbol":"models","correct":"from tencentcloud.tag.v20180813 import models"}],"quickstart":{"code":"from tencentcloud.common import credential\nfrom tencentcloud.tag.v20180813 import tag_client, models\n\n# Replace with your credentials\ncred = credential.Credential(\n    secret_id=os.environ.get('TENCENTCLOUD_SECRET_ID', ''),\n    secret_key=os.environ.get('TENCENTCLOUD_SECRET_KEY', '')\n)\nclient = tag_client.TagClient(cred, 'ap-guangzhou')\n\n# Describe tags\nreq = models.DescribeTagsRequest()\nresp = client.DescribeTags(req)\nprint(resp.total_count)","lang":"python","description":"Initialize client and list tags."},"warnings":[{"fix":"Import Credential from tencentcloud.common.credential and instantiate with secret_id and secret_key.","message":"In 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.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use `from tencentcloud.tag.v20180813 import tag_client` and then `tag_client.TagClient(...)`.","message":"The 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Import models: `from tencentcloud.tag.v20180813 import models`, then create requests with `req = models.DescribeTagsRequest()`.","message":"API request objects are in `models` module. For example, `DescribeTagsRequest` must be imported from `tencentcloud.tag.v20180813.models` (or accessed as `models.DescribeTagsRequest`).","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run `pip install tencentcloud-sdk-python-common` or `pip install tencentcloud-sdk-python-tag` which pulls it automatically.","cause":"Missing base tencentcloud-sdk-python package (common) or not installed.","error":"ModuleNotFoundError: No module named 'tencentcloud'"},{"fix":"Use `from tencentcloud.tag.v20180813 import tag_client` and then `tag_client.TagClient(...)`.","cause":"Incorrect import path; tried direct import of TagClient instead of the module.","error":"AttributeError: module 'tencentcloud.tag.v20180813.tag_client' has no attribute 'TagClient'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}