Registry / database / tencentcloud-sdk-python-redis

tencentcloud-sdk-python-redis

JSON →
library3.1.78pypypi✓ verified 88d ago

Official Tencent Cloud SDK for managing Redis instances via their CREDIS API. Current version 3.1.78. Released frequently alongside the main tencentcloud-sdk-python monorepo.

pip install tencentcloud-sdk-python-redis
INSTALL
IMPORT
SIG · TENCENTCLOUD-SDK-P
T
tencentcloud-sdk-python-redis
databasepythonv3.1.78
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.

RedisClient
✓ from tencentcloud.redis.v20180412 import redis_client
✗ from tencentcloud.redis import RedisClient
Direct top-level import fails; must go through versioned module.
models
✓ from tencentcloud.redis.v20180412 import models
✗ import models
models module is nested inside the versioned package.

Authenticate and list Redis instances.

import os from tencentcloud.common import credential from tencentcloud.redis.v20180412 import redis_client, models cred = credential.Credential( os.environ.get('TENCENTCLOUD_SECRET_ID', ''), os.environ.get('TENCENTCLOUD_SECRET_KEY', '') ) client = redis_client.RedisClient(cred, 'ap-guangzhou') req = models.DescribeInstancesRequest() resp = client.DescribeInstances(req) print(resp.to_json_string())
Debug
Known issues
breakingIn version 3.1.x, the client class moved from `redis_client.RedisClient` to the versioned path `tencentcloud.redis.v20180412.redis_client.RedisClient`.
fix
Use the versioned import as shown in quickstart. Old imports like `from tencentcloud.redis import RedisClient` will fail.
affects: >=3.1.0
gotchaThe SDK silently uses a default region (often 'ap-guangzhou') if none is provided. This can cause unexpected API calls to the wrong region.
fix
Always explicitly pass a region to the client constructor.
affects: all
deprecatedThe old credential environment variables (e.g., `TENCENTCLOUD_SECRET_ID` and `TENCENTCLOUD_SECRET_KEY`) are being replaced by `TENCENTCLOUD_ACCESS_KEY` and `TENCENTCLOUD_SECRET_ACCESS_KEY`.
fix
Use the new variable names. The old ones still work but may be removed in future.
affects: >=3.1.50
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tencentcloud.redis'
Missing dependency: tencentcloud-sdk-python-redis is not installed, or the parent package tencentcloud-sdk-python-common is missing.
fix
Run `pip install tencentcloud-sdk-python-redis` (automatically pulls common).
AttributeError: module 'tencentcloud.redis' has no attribute 'v20180412'
Import path is incorrect; the version subpackage may not be loaded if using a top-level import.
fix
Use explicit import: `from tencentcloud.redis.v20180412 import redis_client`.
tencentcloud.common.exception.TencentCloudSDKException: [InvalidParameter] InvalidParameter
Region parameter is missing or invalid in the request.
fix
Check that the region passed to RedisClient is a valid region code (e.g., 'ap-guangzhou'). Set environment variable or pass directly.
Upgrade
Version history
3.1.78latest on PyPI · released Apr 14, 2026
Audit
Dependencies
tencentcloud-sdk-python-commonrequiredRequired for authentication and base client classes
Agent activity
29 hits · last 30 days
node
24
Anthropic
1
OpenAI (training)
1
Resources