Skip to main content

Unified cloud storage API for storage services.

Project description

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, Minio Cloud 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[minio]
pip install cloudstorage[rackspace]

Changelog

0.8.0 (2018-11-06)

Features

  • Blob and Container’s meta_data is now a case insensitive dictionary.

  • Add new driver for Minio Cloud Storage (#25). Install driver requirements with: pip install cloudstorage[minio].

Other

  • Move to src folder structure for package.

0.7.0 (2018-10-03)

Features

  • Cache-Control supported for Amazon, Google, Local, and Microsoft (#11).

  • Each driver’s package dependencies are now optional (#4).

Other

  • Remove rackspace package dependency rfc6266_parser.

  • Add flake8 linting and sphinx doc building to tox and travis.

0.6 (2018-07-24)

  • Copy metadata from setup.py to setup.cfg

  • Add rate limit timeout when calling google cloud storage backend during tests.

  • Catch UnicodeDecodeError when decoding local file attribute values.

  • Upgrade dependencies and include requirements.txt and dev-requirements.txt.

0.5 (2018-02-26)

  • Update rackspacesdk to 0.7.5 and fix broken API calls (#14).

0.4 (2017-08-29)

  • Implement Microsoft Azure Storage driver (#1).

  • Google upload_blob is failing for binary stream (#7 and #8).

  • Fixed type annotations using mypy.

  • Formatted code using flake8 recommendations.

0.3 (2017-05-24)

  • Fixes #6: Add kwargs to each driver’s init method.

0.2 (2017-04-21)

  • Add pip cache to travis yml file to speed up tests.

  • Set wheel python-tag to py3 only

  • Set tox to pass all env variables to py.test

  • Add travis repo encrypted env variables for running tests.

0.1 (2017-04-20)

  • First release.

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.8.0.tar.gz (111.3 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.8.0-py3-none-any.whl (49.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cloudstorage-0.8.0.tar.gz
  • Upload date:
  • Size: 111.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for cloudstorage-0.8.0.tar.gz
Algorithm Hash digest
SHA256 3be68e4eb745b2a487275ceeba2561561f481ffac42109c9aceaa17194f8e12d
MD5 aa9aa2bf69ea8eff078b9b068f7149a8
BLAKE2b-256 79ec43e14e94e2f659d222cd16c21ab920afc1b41586aa3ad20e7982181ca7db

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cloudstorage-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 49.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for cloudstorage-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67a2725d9a04f343f6126b380c4f41288ae8279e2f3e4f3fa595f1b4695da362
MD5 1fda2c59aa8953d66073b29b40e24e68
BLAKE2b-256 bb98f1e36b331ed23758f6bdcf6c881d98f3b2b5df6416638fe7a4396c4f495d

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