{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "Alibaba Cloud OSS SDK for Python\n================================\n\n.. image:: https://badge.fury.io/py/oss2.svg\n :target: https://badge.fury.io/py/oss2\n.. image:: https://travis-ci.org/aliyun/aliyun-oss-python-sdk.svg?branch=master\n :target: https://travis-ci.org/aliyun/aliyun-oss-python-sdk\n.. image:: https://coveralls.io/repos/github/aliyun/aliyun-oss-python-sdk/badge.svg?branch=master\n :target: https://coveralls.io/github/aliyun/aliyun-oss-python-sdk?branch=master\n\n`README of Chinese `_ \n------------------\n\nOverview\n--------\n\nAlibaba Cloud Object Storage Python SDK 2.x. This version is not compatible with the previous version (Version 0.x). The package name is `oss2` to avoid conflict with previous versions. \n\n\nThe SDK of this version is dependent on the third-party HTTP library `requests `_ and `crcmod`. Install the SDK following the methods below. \n\nNote:\n\n This version does not contain the `osscmd` command line tool. \n\nRunning environment\n-------------------\n\nPython 2.6\uff0c2.7\uff0c3.3\uff0c3.4\uff0c3.5\n\nNote:\n\n Do not use Python 3.3.0 or 3.3.1. Refer to `Python Issue 16658 `_.\n\nInstalling\n----------\n\nInstall the official release version through PIP (taking Linux as an example): \n\n.. code-block:: bash\n\n $ pip install oss2\n\nYou can also install the unzipped installer package directly: \n\n.. code-block:: bash\n\n $ sudo python setup.py install\n\n\nGetting started\n---------------\n\n.. code-block:: python\n\n # -*- coding: utf-8 -*-\n\n import oss2\n\n endpoint = 'http://oss-cn-hangzhou.aliyuncs.com' # Suppose that your bucket is in the Hangzhou region. \n\n auth = oss2.Auth('', '')\n bucket = oss2.Bucket(auth, endpoint, '')\n\n # The object key in the bucket is story.txt\n key = 'story.txt'\n\n # Upload\n bucket.put_object(key, 'Ali Baba is a happy youth.')\n\n # Download\n bucket.get_object(key).read()\n\n # Delete\n bucket.delete_object(key)\n\n # Traverse all objects in the bucket\n for object_info in oss2.ObjectIterator(bucket):\n print(object_info.key)\n\nFor more examples, refer to the code under the \"examples\" directory. \n\nHandling errors\n---------------\n\nThe Python SDK interface will throw an exception in case of an error (see oss2.exceptions sub-module) unless otherwise specified. An example is provided below:\n\n.. code-block:: python\n\n try:\n result = bucket.get_object(key)\n print(result.read())\n except oss2.exceptions.NoSuchKey as e:\n print('{0} not found: http_status={1}, request_id={2}'.format(key, e.status, e.request_id))\n\nTesting\n-------\n\nFirst set the required AccessKeyId, AccessKeySecret, endpoint and bucket information for the test through environment variables (**Do not use the bucket for the production environment**). \nTake the Linux system for example: \n\n.. code-block:: bash\n\n $ export OSS_TEST_ACCESS_KEY_ID=\n $ export OSS_TEST_ACCESS_KEY_SECRET=\n $ export OSS_TEST_ENDPOINT=\n $ export OSS_TEST_BUCKET=\n\n $ export OSS_TEST_STS_ID=\n $ export OSS_TEST_STS_KEY=\n $ export OSS_TEST_STS_ARN=\n\n\nRun the test in the following method: \n\n.. code-block:: bash\n\n $ nosetests # First install nose\n\n\nYou can set environment variable to test auth v2:\n\n.. code-block:: bash\n\n $ export OSS_TEST_AUTH_VERSION=v2\n\nMore resources\n--------------\n- `More examples `_. \n- `Python SDK API documentation `_. \n- `Official Python SDK documentation `_.\n\nContacting us\n-------------\n- `Alibaba Cloud OSS official website `_.\n- `Alibaba Cloud OSS official forum `_.\n- `Alibaba Cloud OSS official documentation center `_.\n- Alibaba Cloud official technical support: `Submit a ticket `_.\n\nLicense\n-------\n- `MIT `_.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://oss.aliyun.com", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pw-oss2", "package_url": "https://pypi.org/project/pw-oss2/", "platform": "", "project_url": "https://pypi.org/project/pw-oss2/", "project_urls": { "Homepage": "http://oss.aliyun.com" }, "release_url": "https://pypi.org/project/pw-oss2/2.4.0/", "requires_dist": [ "requests (!=2.9.0)", "crcmod (>=1.7)" ], "requires_python": "", "summary": "Aliyun OSS (Object Storage Service) SDK", "version": "2.4.0" }, "last_serial": 3712713, "releases": { "2.4.0": [ { "comment_text": "", "digests": { "md5": "c660bb618b14c5b4feb79f5eb83f2836", "sha256": "e255cbf298d36365f8969d6dc185c27bb70f058b09bc8aa1514b16c8eee1813c" }, "downloads": -1, "filename": "pw_oss2-2.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c660bb618b14c5b4feb79f5eb83f2836", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 51964, "upload_time": "2018-03-28T06:36:20", "url": "https://files.pythonhosted.org/packages/f9/ac/1328289af7cd85e0e7d32d3519492bd45192b696123353377b3611d88cf4/pw_oss2-2.4.0-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c660bb618b14c5b4feb79f5eb83f2836", "sha256": "e255cbf298d36365f8969d6dc185c27bb70f058b09bc8aa1514b16c8eee1813c" }, "downloads": -1, "filename": "pw_oss2-2.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c660bb618b14c5b4feb79f5eb83f2836", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 51964, "upload_time": "2018-03-28T06:36:20", "url": "https://files.pythonhosted.org/packages/f9/ac/1328289af7cd85e0e7d32d3519492bd45192b696123353377b3611d88cf4/pw_oss2-2.4.0-py2.py3-none-any.whl" } ] }