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://img.shields.io/codeclimate/github/scottwernervt/cloudstorage.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

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.5.tar.gz (103.1 kB view details)

Uploaded Source

Built Distribution

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

cloudstorage-0.5-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cloudstorage-0.5.tar.gz
  • Upload date:
  • Size: 103.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cloudstorage-0.5.tar.gz
Algorithm Hash digest
SHA256 bfc780c79ad483fdfffd1a62884e965234fad00fc2e19fc8e4fe7d031351ecf9
MD5 e2bea5dd0f9eeb07ef40d222dd94171c
BLAKE2b-256 b4c2004e4f449ead9e5eead5b588a1f933cd30cef9cb6ed4d619827d5324f295

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cloudstorage-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 17d92e4b4be062d893d7336e2c7f10707d1523262398ef74954db055f86efe8f
MD5 94994d8bef26ef40bc31c19bc9ac9471
BLAKE2b-256 874c24b599d396101729b5f0a9409a7d2471adabea6f8757c244b299a7e83179

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