Skip to main content

S3 Utils deals with Amazon S3 buckets

Project description

##S3 Utils v0.5
=====

A light Python wrapper around Amazon Boto library.


##Installation

Install from PyPi:

pip install s3utils

##Example usage in Django


in your settings file::

S3UTILS_DEBUG_LEVEL=1
AWS_ACCESS_KEY_ID = 'your access key'
AWS_SECRET_ACCESS_KEY = 'your secret key'
AWS_STORAGE_BUCKET_NAME = 'your bucket name'

in your code::

>>> from s3utils import S3utils
>>> s3utils = S3utils()
>>> s3utils.cp("path/to/folder","/test/")
copying /path/to/myfolder/test2.txt to test/myfolder/test2.txt
copying /path/to/myfolder/test.txt to test/myfolder/test.txt
copying /path/to/myfolder/hoho/photo.JPG to test/myfolder/hoho/photo.JPG
copying /path/to/myfolder/hoho/haha/ff to test/myfolder/hoho/haha/ff


##Example manual setup

>>> from s3utils import S3utils
>>> s3utils = S3utils(
... AWS_ACCESS_KEY_ID = 'your access key',
... AWS_SECRET_ACCESS_KEY = 'your secret key',
... AWS_STORAGE_BUCKET_NAME = 'your bucket name',
... S3UTILS_DEBUG_LEVEL = 1, #change it to 0 for less verbose
... )
>>> s3utils.cp("path/to/folder","/test/")
copying /path/to/myfolder/test2.txt to test/myfolder/test2.txt
copying /path/to/myfolder/test.txt to test/myfolder/test.txt
copying /path/to/myfolder/hoho/photo.JPG to test/myfolder/hoho/photo.JPG
copying /path/to/myfolder/hoho/haha/ff to test/myfolder/hoho/haha/ff


##Example invalidate CDN cache of files that get overwritten

>>> s3utils.cp("path/to/folder","/test/", invalidate=True)


##Author

Erasmose (Sep Dehpour)
* [Github](https://github.com/erasmose)
* [Linkedin](http://www.linkedin.com/in/sepehr)

Project details


Download files

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

Files for s3utils, version 0.5
Filename, size File type Python version Upload date Hashes
Filename, size s3utils-0.5.tar.gz (118.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page