This topic provides the sample code of Object Storage Service (OSS) SDK for Python in various use cases.

Source code

For more information about the source code of OSS SDK for Python, visit GitHub.

Sample code

OSS SDK for Python provides various sample code files for your reference or use. The following table describes the sample code files provided by OSS SDK for Python.

Sample code file Content Bucket inventory Bucket policy Enable pay-by-requester mode for buckets Quick start, including creating a bucket and uploading, downloading, listing, and deleting objects Upload and manage objects, including managing object metadata, copying objects, and append upload. Upload objects, including resumable upload and multipart upload. Download objects, including streaming download, downloading an object to a local file, range download, and resumable download. Upload progress bars and Download progress bars Upload callback after an object is uploaded Operations related to form upload List objects and Delete objects Query objects Single-connection bandwidth throttling for object upload and download Client-side encryption Server-side encryption Authorized access and use of Security Token Service (STS), including obtaining a temporary credential by assuming a RAM role and using the obtained temporary credential to access OSS Data verification methods (including MD5 and CRC) during object upload and download and data security Operations related to Image Processing (IMG) Operations related to LiveChannel