Skip to main content

pyqcloud-sdk

English · 简体中文

Python Versions PyPI version License: MIT

pyqcloud-sdk is a Python package that simplifies the calling of Tencent Cloud product APIs. With just a product ID, region, operation code, and request parameters, you can achieve API calls. The main features are:

  • Simplified and unified API calling method
  • Automatic handling of authentication, region, and client settings
  • Supports all services supported by the original SDK
  • Supports custom log configuration
  • Based on tencentcloud-sdk-python-common, providing a higher-level abstraction
  • Pre-fetches product interface information from tencentcloud-sdk-python

Installation

Install using pip:

pip install pyqcloud-sdk

Supports Python 3.6+

Quick Start

import logging
from pyqcloud_sdk import Services, setup_logging

# Set up logging (optional)
setup_logging(level=logging.INFO)

# Initialize service
service = Services(
    name="cvm",                   # Service name, required
    region="ap-guangzhou",        # Region, required
    secret_id="your_secret_id",   # Optional, default reads from environment variable
    secret_key="your_secret_key", # Optional, default reads from environment variable
    version="2017-03-12"          # Optional, API version, default is the latest version
)

# Call API
response = service.call("DescribeInstances", {"Limit": 1})
print(response)

Authentication Configuration

It is recommended to set authentication information using environment variables:

  • Default reads TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY
  • Use secret_id_env_name and secret_key_env_name parameters to specify custom environment variable names:
service = Services(
    name="cvm",
    region="ap-guangzhou",
    secret_id_env_name='CUSTOM_ID_ENV',    # Custom environment variable name for SecretId
    secret_key_env_name='CUSTOM_KEY_ENV'   # Custom environment variable name for SecretKey
)

Set your custom environment variables:

export CUSTOM_ID_ENV=your_secret_id
export CUSTOM_KEY_ENV=your_secret_key

Error Handling

from pyqcloud_sdk.exceptions import ServiceError, ClientError

try:
    response = service.call("DescribeInstances", {})
except ServiceError as e:
    print(f"Service error: {e}")
except ClientError as e:
    print(f"Client error: {e}")
...

Custom Logging

from pyqcloud_sdk import setup_logging
import logging

setup_logging(level=logging.DEBUG, format="%(asctime)s - %(levelname)s - %(message)s")

Notes

  1. Keep SecretId and SecretKey safe and avoid leakage.
  2. In production environments, it is recommended to store sensitive information using environment variables or configuration files.
  3. This package automatically handles most API call retries, but special cases may require custom retry logic.
  4. Before using, ensure that the necessary access permissions have been granted in the Tencent Cloud console and that the corresponding services have been enabled.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Related Links

Release files for pyqcloud-sdk 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyqcloud-sdk 0.0.4
File Size Uploaded
pyqcloud_sdk-0.0.4.tar.gz 19.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyqcloud-sdk 0.0.4
File Interpreter ABI Platform
pyqcloud_sdk-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 34.0 kB

Release files / pyqcloud_sdk-0.0.4.tar.gz

Download URL pyqcloud_sdk-0.0.4.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f70858a05bc2d4584a890da3d86627369611cabdce6ba89fc5ce449a6057c3d3
BLAKE2b-256 checksum
How to use checksums
e4ee82039502e1a8d20af71c5667bbba28c1d2734d96ea66780e7d7eb0bc03dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 12, 2025.

Transparency log

Release files / pyqcloud_sdk-0.0.4-py3-none-any.whl

Download URL pyqcloud_sdk-0.0.4-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f50d700f0f6b2c250a6ddd5fb91eea1cc2fc96c73715ba6134a70d112cd4a71
BLAKE2b-256 checksum
How to use checksums
b95eece99ef5abb317083edfbf7f069be3fe58e345623fc593ac9e750e60d2ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 12, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page