pyqcloud-sdk


Namepyqcloud-sdk JSON
Version 0.0.2 PyPI version JSON
download
home_pageNone
SummaryA wrapper for tencentcloud-sdk-python-common
upload_time2024-09-04 14:44:46
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseMIT
keywords python sdk tencentcloud wrapper
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyqcloud-sdk

**English** · [简体中文](./README.zh-CN.md)

[![Python Versions](https://img.shields.io/pypi/pyversions/pyqcloud-sdk.svg)](https://pypi.org/project/pyqcloud-sdk)
[![PyPI version](https://badge.fury.io/py/pyqcloud-sdk.svg)](https://badge.fury.io/py/pyqcloud-sdk)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/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](https://github.com/TencentCloud/tencentcloud-sdk-python/tree/master/tencentcloud)

## Installation

Install using pip:

```console
pip install pyqcloud-sdk
```

Supports Python 3.6+

## Quick Start

```python
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 `set_secret_from_env()` to specify custom environment variable names:

```python
service.set_secret_from_env('CUSTOM_ID_ENV', 'CUSTOM_KEY_ENV')
```

## Error Handling

```python
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

```python
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](LICENSE) file for details.

## Related Links

- [Tencent Cloud API Documentation](https://cloud.tencent.com/document/api)
- [tencentcloud-sdk-python](https://github.com/TencentCloud/tencentcloud-sdk-python)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyqcloud-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "python, sdk, tencentcloud, wrapper",
    "author": null,
    "author_email": "YongSangUn <sangun.yong@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/94/e0/abb6724c067a95aa9982c0d3af728ae0a6c52262008a2dcaf80f6435b24f/pyqcloud_sdk-0.0.2.tar.gz",
    "platform": null,
    "description": "# pyqcloud-sdk\n\n**English** \u00b7 [\u7b80\u4f53\u4e2d\u6587](./README.zh-CN.md)\n\n[![Python Versions](https://img.shields.io/pypi/pyversions/pyqcloud-sdk.svg)](https://pypi.org/project/pyqcloud-sdk)\n[![PyPI version](https://badge.fury.io/py/pyqcloud-sdk.svg)](https://badge.fury.io/py/pyqcloud-sdk)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\npyqcloud-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:\n\n- Simplified and unified API calling method\n- Automatic handling of authentication, region, and client settings\n- Supports all services supported by the original SDK\n- Supports custom log configuration\n- Based on tencentcloud-sdk-python-common, providing a higher-level abstraction\n- Pre-fetches product interface information from [tencentcloud-sdk-python](https://github.com/TencentCloud/tencentcloud-sdk-python/tree/master/tencentcloud)\n\n## Installation\n\nInstall using pip:\n\n```console\npip install pyqcloud-sdk\n```\n\nSupports Python 3.6+\n\n## Quick Start\n\n```python\nimport logging\nfrom pyqcloud_sdk import Services, setup_logging\n\n# Set up logging (optional)\nsetup_logging(level=logging.INFO)\n\n# Initialize service\nservice = Services(\n    name=\"cvm\",                   # Service name, required\n    region=\"ap-guangzhou\",        # Region, required\n  secret_id=\"your_secret_id\",     # Optional, default reads from environment variable\n    secret_key=\"your_secret_key\", # Optional, default reads from environment variable\n    version=\"2017-03-12\"          # Optional, API version, default is the latest version\n)\n\n# Call API\nresponse = service.call(\"DescribeInstances\", {\"Limit\": 1})\nprint(response)\n```\n\n## Authentication Configuration\n\nIt is recommended to set authentication information using environment variables:\n\n- Default reads `TENCENTCLOUD_SECRET_ID` and `TENCENTCLOUD_SECRET_KEY`\n- Use `set_secret_from_env()` to specify custom environment variable names:\n\n```python\nservice.set_secret_from_env('CUSTOM_ID_ENV', 'CUSTOM_KEY_ENV')\n```\n\n## Error Handling\n\n```python\nfrom pyqcloud_sdk.exceptions import ServiceError, ClientError\n\ntry:\n    response = service.call(\"DescribeInstances\", {})\nexcept ServiceError as e:\n    print(f\"Service error: {e}\")\nexcept ClientError as e:\n    print(f\"Client error: {e}\")\n...\n```\n\n## Custom Logging\n\n```python\nfrom pyqcloud_sdk import setup_logging\nimport logging\n\nsetup_logging(level=logging.DEBUG, format=\"%(asctime)s - %(levelname)s - %(message)s\")\n```\n\n## Notes\n\n1. Keep SecretId and SecretKey safe and avoid leakage.\n2. In production environments, it is recommended to store sensitive information using environment variables or configuration files.\n3. This package automatically handles most API call retries, but special cases may require custom retry logic.\n4. Before using, ensure that the necessary access permissions have been granted in the Tencent Cloud console and that the corresponding services have been enabled.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Related Links\n\n- [Tencent Cloud API Documentation](https://cloud.tencent.com/document/api)\n- [tencentcloud-sdk-python](https://github.com/TencentCloud/tencentcloud-sdk-python)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A wrapper for tencentcloud-sdk-python-common",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/YongSangUn/pyqcloud-sdk",
        "Source": "https://github.com/YongSangUn/pyqcloud-sdk",
        "Tracker": "https://github.com/YongSangUn/pyqcloud-sdk/issues"
    },
    "split_keywords": [
        "python",
        " sdk",
        " tencentcloud",
        " wrapper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "06d7950663562473aeae81870dc17f06aa873ea7d72eafd1605cb468a1a3dbad",
                "md5": "de603a176a3d0f64d8d073d41c33f0a2",
                "sha256": "bfc6b05075a8079f0ca94cc6423fc2667fb118d32cfd6fe759bdd9663813054a"
            },
            "downloads": -1,
            "filename": "pyqcloud_sdk-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "de603a176a3d0f64d8d073d41c33f0a2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 13471,
            "upload_time": "2024-09-04T14:44:44",
            "upload_time_iso_8601": "2024-09-04T14:44:44.719158Z",
            "url": "https://files.pythonhosted.org/packages/06/d7/950663562473aeae81870dc17f06aa873ea7d72eafd1605cb468a1a3dbad/pyqcloud_sdk-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "94e0abb6724c067a95aa9982c0d3af728ae0a6c52262008a2dcaf80f6435b24f",
                "md5": "1c48e953f43c38cd328b21a5358f1a16",
                "sha256": "0b22c3d289619ec60b70d35a341edd16a001d4ac3066826028b6024961c382a9"
            },
            "downloads": -1,
            "filename": "pyqcloud_sdk-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "1c48e953f43c38cd328b21a5358f1a16",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 16331,
            "upload_time": "2024-09-04T14:44:46",
            "upload_time_iso_8601": "2024-09-04T14:44:46.410119Z",
            "url": "https://files.pythonhosted.org/packages/94/e0/abb6724c067a95aa9982c0d3af728ae0a6c52262008a2dcaf80f6435b24f/pyqcloud_sdk-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-04 14:44:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "YongSangUn",
    "github_project": "pyqcloud-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyqcloud-sdk"
}
        
Elapsed time: 0.36163s