Skip to main content

A Simple OSS SDK Integration. Include Aliyun, Qiniu, Qcloud, Maybe more

Project description

A Simple OSS SDK Integration. Include Aliyun, Qiniu, Qcloud, Maybe more

Very Easy for use!

from sun_oss import get_aliyun_bucket, get_qiniu_bucket, get_qcloud_bucket

# aliyun access_key_id = os.getenv(‘ALI_OSS_ACCESS_KEY_ID’, ‘<your ALI_OSS_ACCESS_KEY_ID>’) access_key_secret = os.getenv(‘ALI_OSS_ACCESS_KEY_SECRET’, ‘<your ALI_OSS_ACCESS_KEY_SECRET>’) endpoint = os.getenv(‘ALI_OSS_ENDPOINT’, ‘<your ALI_OSS_ENDPOINT>’) bucket_name = os.getenv(‘BUCKET_NAME’, ‘<your BUCKET-NAME>’) ali_bucket = get_aliyun_bucket(access_key_id, access_key_secret, bucket_name, endpoint)

#qiniu access_key_id = os.getenv(‘QINIU_OSS_ACCESS_KEY_ID’, ‘<your QINIU_OSS_ACCESS_KEY_ID>’) access_key_secret = os.getenv(‘QINIU_OSS_ACCESS_KEY_SECRET’, ‘<your QINIU_OSS_ACCESS_KEY_SECRET>’) bucket_name = os.getenv(‘BUCKET_NAME’, ‘<your BUCKET-NAME>’) qiniu_bucket = get_qiniu_bucket(access_key_id, access_key_secret, bucket_name)

access_key_id = os.getenv(‘TENTCENT_OSS_ACCESS_KEY_ID’, ‘<your TENTCENT_OSS_ACCESS_KEY_ID>’) access_key_secret = os.getenv(‘TENTCENT_OSS_ACCESS_KEY_SECRET’, ‘<your TENTCENT_OSS_ACCESS_KEY_SECRET>’) region = os.getenv(‘TENTCENT_REGION’, ‘<your BUCKET-NAME>’) qcloud_bucket = get_qcloud_bucket(access_key_id, access_key_secret, region, bucket_name)

#upload ret = ali_bucket.put_object(upload_file)


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sun_oss-0.1.3.tar.gz (6.4 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page