{ "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\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\nSetup Logging\n---------------\n\nThe following code can set the logging level of 'oss2'.\n .. code-block:: python\n\n import logging\n logging.getLogger('oss2').setLevel(logging.WARNING)\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 `_.", "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": "oss2-test-1", "package_url": "https://pypi.org/project/oss2-test-1/", "platform": "", "project_url": "https://pypi.org/project/oss2-test-1/", "project_urls": { "Homepage": "http://oss.aliyun.com" }, "release_url": "https://pypi.org/project/oss2-test-1/2.6.2/", "requires_dist": null, "requires_python": "", "summary": "Aliyun OSS (Object Storage Service) SDK", "version": "2.6.2" }, "last_serial": 5418570, "releases": { "2.6.2": [ { "comment_text": "", "digests": { "md5": "272bb2651d9402231b97216abcda912d", "sha256": "f49b11de9673a9dbcd1b5166720046a53da789494152d16f02ce50e8d985176a" }, "downloads": -1, "filename": "oss2-test-1-2.6.2.tar.gz", "has_sig": false, "md5_digest": "272bb2651d9402231b97216abcda912d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 156860, "upload_time": "2019-06-19T05:06:50", "url": "https://files.pythonhosted.org/packages/ca/1f/4a6644613d932f71ec84fc9bc09f6d15115f08212fd7b80815aef6fa4f14/oss2-test-1-2.6.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "272bb2651d9402231b97216abcda912d", "sha256": "f49b11de9673a9dbcd1b5166720046a53da789494152d16f02ce50e8d985176a" }, "downloads": -1, "filename": "oss2-test-1-2.6.2.tar.gz", "has_sig": false, "md5_digest": "272bb2651d9402231b97216abcda912d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 156860, "upload_time": "2019-06-19T05:06:50", "url": "https://files.pythonhosted.org/packages/ca/1f/4a6644613d932f71ec84fc9bc09f6d15115f08212fd7b80815aef6fa4f14/oss2-test-1-2.6.2.tar.gz" } ] }