{"id":28358,"library":"tencentcloud-sdk-python-sts","title":"Tencent Cloud STS SDK for Python","description":"Official Tencent Cloud SDK for accessing the Security Token Service (STS), used to obtain temporary credentials for accessing Tencent Cloud resources. The current version is 3.0.1459 and is updated regularly with new features and fixes.","status":"active","version":"3.0.1459","language":"python","source_language":"en","source_url":"https://github.com/TencentCloud/tencentcloud-sdk-python","tags":["tencent-cloud","sts","cloud-sdk"],"install":[{"cmd":"pip install tencentcloud-sdk-python-sts","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Core client and credential classes","package":"tencentcloud-sdk-python-common","optional":false},{"reason":"HTTP requests","package":"requests","optional":false}],"imports":[{"note":"The correct import includes the API version. The old import will raise ImportError.","wrong":"from tencentcloud.sts import StsClient","symbol":"StsClient","correct":"from tencentcloud.sts.v20180813 import sts_client"},{"note":"Models must be imported with version path.","wrong":"from tencentcloud.sts import models","symbol":"models","correct":"from tencentcloud.sts.v20180813 import models"}],"quickstart":{"code":"from tencentcloud.common import credential\nfrom tencentcloud.sts.v20180813 import sts_client, models\n\ncred = credential.Credential(\n    secret_id=os.environ.get('TENCENTCLOUD_SECRET_ID', ''),\n    secret_key=os.environ.get('TENCENTCLOUD_SECRET_KEY', '')\n)\nclient = sts_client.StsClient(cred, 'ap-guangzhou')\nreq = models.GetFederationTokenRequest()\nreq.Name = 'test'\nreq.Policy = ''\nresp = client.GetFederationToken(req)\nprint(resp.Credentials)","lang":"python","description":"Basic usage to get a temporary federation token. Set credentials via environment variables."},"warnings":[{"fix":"Use from tencentcloud.sts.v20180813 import sts_client instead of from tencentcloud.sts import sts_client.","message":"Import paths changed after SDK v3.0.xxx; now require version suffix in import path.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Always use v20180813 in import paths.","message":"The STS API version 2018-08-13 is current; older versions are no longer supported.","severity":"deprecated","affected_versions":"all"},{"fix":"Always set required fields to valid strings/values before calling the API.","message":"Some API models have required fields (e.g., Name in GetFederationTokenRequest) that must not be empty or null.","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":"Install tencentcloud-sdk-python-common and use correct import: from tencentcloud.sts.v20180813 import sts_client","cause":"Incorrect import path or missing common package.","error":"ModuleNotFoundError: No module named 'tencentcloud.sts'"},{"fix":"Ensure all required fields are set in the request model before passing to client.","cause":"API request field not set (None) when required.","error":"'NoneType' object has no attribute 'xxx'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}