{"id":13714403,"url":"https://github.com/aliyun/aliyun-openapi-python-sdk","last_synced_at":"2025-05-07T01:34:09.207Z","repository":{"id":35297728,"uuid":"39558861","full_name":"aliyun/aliyun-openapi-python-sdk","owner":"aliyun","description":"Alibaba Cloud SDK for Python","archived":false,"fork":false,"pushed_at":"2024-04-12T03:54:57.000Z","size":18545,"stargazers_count":995,"open_issues_count":19,"forks_count":591,"subscribers_count":76,"default_branch":"master","last_synced_at":"2024-04-14T07:49:31.098Z","etag":null,"topics":["alibaba-cloud-python","alibaba-cloud-sdk","development-kit","python","sdk"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aliyun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-07-23T09:39:45.000Z","updated_at":"2024-04-15T10:00:37.432Z","dependencies_parsed_at":"2023-01-17T00:46:18.419Z","dependency_job_id":"7b567140-057a-4f2b-823e-8e54e685b8d8","html_url":"https://github.com/aliyun/aliyun-openapi-python-sdk","commit_stats":{"total_commits":3726,"total_committers":40,"mean_commits":93.15,"dds":0.2536231884057971,"last_synced_commit":"ecbd798bccb090f49f122703e0a00ab143e84f41"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Faliyun-openapi-python-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Faliyun-openapi-python-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Faliyun-openapi-python-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Faliyun-openapi-python-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliyun","download_url":"https://codeload.github.com/aliyun/aliyun-openapi-python-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223386248,"owners_count":17137167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alibaba-cloud-python","alibaba-cloud-sdk","development-kit","python","sdk"],"created_at":"2024-08-02T23:01:58.821Z","updated_at":"2025-05-07T01:34:09.181Z","avatar_url":"https://github.com/aliyun.png","language":"Python","readme":"# Alibaba Cloud Python Software Development Kit\n\n[![PyPI version](https://badge.fury.io/py/aliyun-python-sdk-core.svg)](https://badge.fury.io/py/aliyun-python-sdk-core)\n[![Python test](https://github.com/aliyun/aliyun-openapi-python-sdk/actions/workflows/test.yml/badge.svg)](https://github.com/aliyun/aliyun-openapi-python-sdk/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/aliyun/aliyun-openapi-python-sdk/graph/badge.svg?token=qmWxah6dPs)](https://codecov.io/gh/aliyun/aliyun-openapi-python-sdk)\n[![python](https://img.shields.io/pypi/pyversions/aliyun-python-sdk-core.svg)](https://img.shields.io/pypi/pyversions/aliyun-python-sdk-core.svg)\n\n[中文文档](./README_zh.md)\n\nThe Alibaba Cloud V1.0 SDK will soon enter the Basic Security Maintenance phase and is no longer recommended for use. It is suggested to use the V2.0 SDK instead.\n\n## Troubleshoot\n\n[Troubleshoot](https://api.alibabacloud.com/troubleshoot?source=github_sdk) Provide OpenAPI diagnosis service to help developers locate quickly and provide solutions for developers through `RequestID` or `error message`.\n\n## Online Demo\n\n**[API Developer Portal](https://api.alibabacloud.com)** provides the ability to call the cloud product OpenAPI online, and dynamically generate SDK Example code and quick retrieval interface, which can significantly reduce the difficulty of using the cloud API. **It is highly recommended**.\n\n\u003ca href=\"https://api.alibabacloud.com\" target=\"api_explorer\"\u003e\n  \u003cimg src=\"https://img.alicdn.com/tfs/TB12GX6zW6qK1RjSZFmXXX0PFXa-744-122.png\" width=\"180\" /\u003e\n\u003c/a\u003e\n\n## Important Updates\n\n- Starting from version 2.16.0, the Alibaba Cloud Python SDK core library `aliyun-python-sdk-core` only supports Python 3.7 and above.\n\n## Documentation\n\n- [Requirements](docs/0-Requirement-EN.md)\n- [Installation](./docs/1-Installation-EN.md)\n- [Client \u0026 Credentials](./docs/2-Client-EN.md)\n- [Timeout](./docs/3-Timeout-EN.md)\n- [Proxy Configurations](./docs/4-Proxy-EN.md)\n- [Log](./docs/5-Log-EN.md)\n- [Endpoint](./docs/6-Endpoint-EN.md)\n- [Https](./docs/7-Https-EN.md)\n- [Debug](./docs/8-Debug-EN.md)\n- [Exception](./docs/9-Exception-EN.md)\n\n## Prerequisites\n\n- To use Alibaba Cloud Python SDK, you must have an Alibaba Cloud account as well as an AccessKey.\n\n\tThe AccessKey is required when initializing `AcsClient`. You can create an AccessKey in the Alibaba Cloud console. For more information, see [Create an AccessKey](https://usercenter.console.aliyun.com/?spm=5176.doc52740.2.3.QKZk8w#/manage/ak).\n\n\t\u003e **Note:** To increase the security of your account, we recommend that you use the AccessKey of the RAM user to access Alibaba Cloud services.\n\n- To use Alibaba Cloud Python SDK to access the APIs of a product, you must first activate the product on the [Alibaba Cloud console](https://home.console.aliyun.com/?spm=5176.doc52740.2.4.QKZk8w) if required.\n\n- Alibaba Cloud Python SDK requires Python 3.7.x and above.\n\n## Install Python SDK\n\nAlibaba Cloud Python SDK supports Python 3.7.x and above. Run ``python --version`` to check your version of Python.\n\nYou can install the Alibaba Cloud Python SDK using the following two methods. Regardless of which method and cloud service are used, the core library `aliyun-python-sdk-core` must be installed.\n\n- **Install with pip**\n\n\tPython SDK uses a common package management tool named `pip`. If pip is not installed, see the [pip user guide](https://pip.pypa.io/en/stable/installing/?spm=5176.doc53090.2.7.zHDiNV \"pip User Guide\") to install pip.\n\n\tRun the following command to install the individual libraries of Alibaba Cloud services:\n\n\t```bash\n\t# Install the core library\n\tpip install aliyun-python-sdk-core\n\t# Install the ECS management library\n\tpip install aliyun-python-sdk-ecs\n\t# Install the RDS management library\n\tpip install aliyun-python-sdk-rds\n\t```\n\n## Use Python SDK\n\n1. Import the required modules as follows:\n\n    ```python\n    from aliyunsdkcore.client import AcsClient\n    from aliyunsdkcore.acs_exception.exceptions import ClientException\n    from aliyunsdkcore.acs_exception.exceptions import ServerException\n    from aliyunsdkecs.request.v20140526 import DescribeInstancesRequest\n    from aliyunsdkecs.request.v20140526 import StopInstanceRequest\n    ```\n2. Initialize the `AcsClient` instance:\n\n    ```python\n    client = AcsClient(\n        \"\u003caccess-key-id\u003e\",\n        \"\u003caccess-key-secret\u003e\",\n        \"\u003cregion-id\u003e\"\n    )\n    ```\n\n\twhere:\n\n\t- `access-key-id` is the Accesskey ID for your account.\n\t- `access-key-secret` is the AccessKey secret for your account.\n\t- `region-id` is the ID of the region where the service is called. For a list of region IDs, see [Regions and zones](https://www.alibabacloud.com/help/doc-detail/40654.html).\n\n\t\u003e **Note:** The sequence of these parameters cannot be changed.\n\n3. Initialize a request and print response.\n\n\t```python\n\t# Initialize a request and set parameters\n\trequest = DescribeInstancesRequest.DescribeInstancesRequest()\n\trequest.set_PageSize(10)\n\t# Print response\n\tresponse = client.do_action_with_exception(request)\n\tprint response\n\t```\n\n## Code example\n\nThe following example shows how to query a list of ECS instances in a specific region using [DescribeInstances](~~25506~~). Substitute the values for `your-access-key-id`, `your-access-key-secret`, and `your-region-id`.\n\n```python\n# -*- coding: utf8 -*-\n\nfrom aliyunsdkcore.client import AcsClient\nfrom aliyunsdkcore.acs_exception.exceptions import ClientException\nfrom aliyunsdkcore.acs_exception.exceptions import ServerException\nfrom aliyunsdkecs.request.v20140526 import DescribeInstancesRequest\nfrom aliyunsdkecs.request.v20140526 import StopInstanceRequest\n\n# Initialize AcsClient instance\nclient = AcsClient(\n  \"\u003cyour-access-key-id\u003e\",\n  \"\u003cyour-access-key-secret\u003e\",\n  \"\u003cyour-region-id\u003e\"\n)\n\n# Initialize a request and set parameters\nrequest = DescribeInstancesRequest.DescribeInstancesRequest()\nrequest.set_PageSize(10)\n\n# Print response\nresponse = client.do_action_with_exception(request)\nprint response\n```\n\n## HTTP DEBUG\n\nTo use the function `HTTP DEBUG`, you must set `DEBUG` in your environment variable, the corresponding value\nmay be `sdk` or `SDK`.\n\nThe following example shows what the `HTTP DEBUG` do, which will help you debug your codes.\n\n```plaintext\n\u003e GET /databases?RegionId=cn-hangzhou HTTP/1.1\n\u003e Host : ads.cn-hangzhou.aliyuncs.com\n\u003e User-Agent : AlibabaCloud (Windows 10;AMD64) Python/3.7.1 Core/2.13.1 python-requests/2.18.1\n\u003e accept-encoding : *\n\u003e Accept : application/json\n\u003e Connection : keep-alive\n\u003e x-sdk-invoke-type : normal\n\u003e x-acs-version : 2019-01-22\n\u003e x-acs-region-id : cn-hangzhou\n\u003e Date : Thu, 21 Feb 2019 08:00:50 GMT\n\u003e x-acs-signature-method : HMAC-SHA1\n\u003e x-acs-signature-version : 1.0\n\u003e Authorization : acs ...\n\u003e x-sdk-client : python/2.0.0\n\n\u003c HTTP/1.1 503 SERVICE_UNAVAILABLE\n\u003c Date : Thu, 21 Feb 2019 08:00:50 GMT\n\u003c Content-Type : application/json; charset=UTF-8\n\u003c Content-Length : 297\n\u003c Connection : keep-alive\n\u003c Access-Control-Allow-Origin : *\n\u003c Access-Control-Allow-Methods : POST, GET, OPTIONS\n\u003c Access-Control-Allow-Headers : X-Requested-With, X-Sequence, _aop_secret, _aop_signature\n\u003c Access-Control-Max-Age : 172800\n\u003c x-acs-request-id : 670F3D09-F8E7-4144-83C3-B56C35DA35ED\n\u003c Server : Jetty(7.2.2.v20101205)\n```\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliyun%2Faliyun-openapi-python-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliyun%2Faliyun-openapi-python-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliyun%2Faliyun-openapi-python-sdk/lists"}