Registry / aws / tencentcloud-sdk-python-afc

tencentcloud-sdk-python-afc

JSON →
library3.0.1459pypypi✓ verified 84d ago

Tencent Cloud Afc (Anti-Fraud Cloud) SDK for Python. Provides access to Tencent Cloud's anti-fraud services. Current version: 3.0.1459. Released approximately weekly as part of the Tencent Cloud Python SDK monorepo. Active development.

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

AfcClient
from tencentcloud.afc.v20200226 import afc_client
from tencentcloud.afc import AfcClient
The SDK uses versioned subpackages. 'afc' alone is ambiguous; the correct import includes the API version (v20200226).
models
from tencentcloud.afc.v20200226 import models
from tencentcloud.afc import models
Module 'models' is under the versioned path.

Instantiate the AfcClient with credentials and region, then call QueryAntiFraudVip.

import os from tencentcloud.common import credential from tencentcloud.afc.v20200226 import afc_client, models try: cred = credential.Credential( os.environ.get('TENCENTCLOUD_SECRET_ID'), os.environ.get('TENCENTCLOUD_SECRET_KEY') ) client = afc_client.AfcClient(cred, 'ap-guangzhou') req = models.QueryAntiFraudVipRequest() req.PhoneNumber = '12345678901' resp = client.QueryAntiFraudVip(req) print(resp) except Exception as e: print(e)
Debug
Known issues
gotchaSDK v3 uses versioned subpackages (e.g., v20200226). Older examples may reference 'afc_client' directly under 'tencentcloud.afc' which is incorrect.
fix
Use the full versioned import path: `from tencentcloud.afc.v20200226 import afc_client, models`
affects: >=3.0
gotchaRegion must be specified when creating the client. Default is 'ap-guangzhou'. Some services require a specific region; check Tencent Cloud documentation.
fix
Always pass a region string (e.g., 'ap-guangzhou', 'ap-beijing') to the client constructor.
affects: all
breakingRequest and response models changed in v3. v2-style direct dictionary access is deprecated. Use model attributes.
fix
Instantiate request models with keyword arguments: `req = models.QueryAntiFraudVipRequest(PhoneNumber='12345678901')` instead of dict assignment.
affects: >=3.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tencentcloud'
Base 'tencentcloud-sdk-python' package not installed.
fix
Run: pip install tencentcloud-sdk-python-afc (it depends on the base package automatically)
AttributeError: module 'tencentcloud.afc' has no attribute 'afc_client'
Incorrect import path; missing versioned subpackage.
fix
Use: from tencentcloud.afc.v20200226 import afc_client
tencentcloud.common.exception.TencentCloudSDKException: [TencentCloudSDKException] code: AuthFailure.SecretIdNotFound
Invalid or missing secret ID/secret key.
fix
Set environment variables TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY, or pass credentials directly.
Upgrade
Version history
3.0.1459latest on PyPI · released Sep 15, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
16
Resources
tencentcloud-sdk-python-afc — pip install tencentcloud-sdk-python-afc · libregistry