Skip to main content

Unified cloud storage API for storage services.

Project description

https://img.shields.io/pypi/v/cloudstorage.svg https://img.shields.io/pypi/l/cloudstorage.svg https://img.shields.io/pypi/wheel/cloudstorage.svg https://img.shields.io/pypi/pyversions/cloudstorage.svg https://travis-ci.org/scottwernervt/cloudstorage.svg?branch=master https://codeclimate.com/github/scottwernervt/cloudstorage/badges/gpa.svg

Cloud Storage is a Python +3.4 package which creates a unified API for the cloud storage services: Amazon Simple Storage Service (S3), Microsoft Azure Storage, Rackspace Cloud Files, Google Cloud Storage, and the Local File System.

Cloud Storage is inspired by Apache Libcloud. Advantages to Apache Libcloud Storage are:

  • Full Python 3 support.

  • Generate temporary signed URLs for downloading and uploading files.

  • Support for request and response headers like Content-Disposition.

  • Pythonic! Iterate through all blobs in containers and all containers in storage using respective objects.

Usage

>>> from cloudstorage.drivers.amazon import S3Driver
>>> storage = S3Driver(key='<my-aws-access-key-id>', secret='<my-aws-secret-access-key>')

>>> container = storage.create_container('avatars')
>>> container.cdn_url
'https://avatars.s3.amazonaws.com/'

>>> avatar_blob = container.upload_blob('/path/my-avatar.png')
>>> avatar_blob.cdn_url
'https://s3.amazonaws.com/avatars/my-avatar.png'

>>> avatar_blob.generate_download_url(expires=3600)
'https://avatars.s3.amazonaws.com/my-avatar.png?'
'AWSAccessKeyId=<my-aws-access-key-id>'
'&Signature=<generated-signature>'
'&Expires=1491849102'

>>> container.generate_upload_url('user-1-avatar.png', expires=3600)
{
    'url': 'https://avatars.s3.amazonaws.com/',
    'fields': {
        'key': 'user-1-avatar.png',
        'AWSAccessKeyId': '<my-aws-access-key-id>',
        'policy': '<generated-policy>',
        'signature': '<generated-signature>'
    }
}

Supported Services

Installation

To install Cloud Storage:

pip install cloudstorage

Also install the storage driver(s) you will be using:

pip install cloudstorage[amazon]
pip install cloudstorage[google]
pip install cloudstorage[local]
pip install cloudstorage[microsoft]
pip install cloudstorage[rackspace]

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

cloudstorage-0.7.0.tar.gz (6.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloudstorage-0.7.0-py3-none-any.whl (42.9 kB view details)

Uploaded Python 3

File details

Details for the file cloudstorage-0.7.0.tar.gz.

File metadata

  • Download URL: cloudstorage-0.7.0.tar.gz
  • Upload date:
  • Size: 6.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for cloudstorage-0.7.0.tar.gz
Algorithm Hash digest
SHA256 c13270b1d0804e606030dd1e760ae1ea2c7f5ae19091f39825a554d7722d48b2
MD5 fc45614e45dcac7d5ba214e7f6d187ef
BLAKE2b-256 54f945e812600e59aed5476eb28b99613712dd6fc665a6969a173ad45f4710cd

See more details on using hashes here.

File details

Details for the file cloudstorage-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: cloudstorage-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 42.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for cloudstorage-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3adeb727ff898e3ebc3c17714ab5657bf509f2e9b2fd27e65b4b7a43fde3f32b
MD5 47eef796174f912f24b83163009af695
BLAKE2b-256 532587a14d8e2e937208a8548d53063d1e11b594b2299f681a6ae51fd43d68c2

See more details on using hashes here.

Supported by

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