Registry / aws / tencentcloud-sdk-python-sts

tencentcloud-sdk-python-sts

JSON →
library3.0.1459pypypi✓ verified 84d ago

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.

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

StsClient
from tencentcloud.sts.v20180813 import sts_client
from tencentcloud.sts import StsClient
The correct import includes the API version. The old import will raise ImportError.
models
from tencentcloud.sts.v20180813 import models
from tencentcloud.sts import models
Models must be imported with version path.

Basic usage to get a temporary federation token. Set credentials via environment variables.

from tencentcloud.common import credential from tencentcloud.sts.v20180813 import sts_client, models cred = credential.Credential( secret_id=os.environ.get('TENCENTCLOUD_SECRET_ID', ''), secret_key=os.environ.get('TENCENTCLOUD_SECRET_KEY', '') ) client = sts_client.StsClient(cred, 'ap-guangzhou') req = models.GetFederationTokenRequest() req.Name = 'test' req.Policy = '' resp = client.GetFederationToken(req) print(resp.Credentials)
Debug
Known issues
breakingImport paths changed after SDK v3.0.xxx; now require version suffix in import path.
fix
Use from tencentcloud.sts.v20180813 import sts_client instead of from tencentcloud.sts import sts_client.
affects: >=3.0.0
deprecatedThe STS API version 2018-08-13 is current; older versions are no longer supported.
fix
Always use v20180813 in import paths.
affects: all
gotchaSome API models have required fields (e.g., Name in GetFederationTokenRequest) that must not be empty or null.
fix
Always set required fields to valid strings/values before calling the API.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tencentcloud.sts'
Incorrect import path or missing common package.
fix
Install tencentcloud-sdk-python-common and use correct import: from tencentcloud.sts.v20180813 import sts_client
'NoneType' object has no attribute 'xxx'
API request field not set (None) when required.
fix
Ensure all required fields are set in the request model before passing to client.
Upgrade
Version history
3.0.1459latest on PyPI · released Sep 15, 2025
Audit
Dependencies
tencentcloud-sdk-python-commonrequiredCore client and credential classes
requestsrequiredHTTP requests
Agent activity
34 hits · last 30 days
node
32
Amazon
1
Resources
tencentcloud-sdk-python-sts — pip install tencentcloud-sdk-python-sts · libregistry