Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

pypm install pyawsbuckets

How to install pyawsbuckets

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install pyawsbuckets
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.2.0Never BuiltWhy not?
1.0.5 Available View build log
Windows (64-bit)
1.2.0Never BuiltWhy not?
1.0.5 Available View build log
Mac OS X (10.5+)
1.2.0Never BuiltWhy not?
1.0.5 Available View build log
Linux (32-bit)
1.2.0Never BuiltWhy not?
1.0.5 Available View build log
Linux (64-bit)
1.2.0 Available View build log
1.0.5 Available View build log
Lastest release
version 1.2.0 on Jan 9th, 2014

Handle Amazon S3 interactions

Objects / files can be put into S3, retrieved from and deleted from S3. Also signed URLs can be generated to allow limited-time access to a particular object in an S3 bucket.

Requires Python 2.7 or above.

Available as Python package at http://pypi.python.org/pypi/pyawsbuckets [ pip install pyawsbuckets ] Source at https://github.com/mhenwood/pyawsbuckets



Initiate the access object with your credentials:

from pyawsbuckets import AwsInterface
aws_interface = AwsInterface(amazon_access_key, amazon_secret_key)
PUT object

Put an object into an existing bucket at S3 (repeat: the bucket must ALREADY exist):


Put an object into an existing bucket at S3, activating server-side encryption for that object:


The put method also accepts an optional content_type keyword argument which should be a standard internet media type (e.g. "image/jpeg")

GET object

Retrieve a given object from a given bucket:

object_contents = aws_interface(
DELETE object

Delete an object from S3:

aws_interface.delete('bucket999', 'somefile.pdf')
Expiring access URL

Get a signed URL which gives access to a private object, but only for (e.g.) 15 minutes. This is useful if you wish for users to be able to download private objects directly, but only for a brief window of time (to stop, for example, link sharing):

expiring_url = aws_interface.sign_object_request('https', 'bucket999', 'somefile.pdf', 15)

You can specify 'https' as the protocol for putting/getting files and for signing.

However you should bear in mind that given the way wildcard certificates work, the certificate presented by the S3 service will not match the requested hostname if your bucket name contains dots (periods).

This is because a certificate for "*.s3.amazon.com" will work nicely for hostnames like "foo.s3.amazon.com" and "foo-example-com.s3.example.com" but will NOT work for hostnames like "foo.bar.s3.amazon.com". This is a feature of wildcard certificates and their jurisdiction, not of S3 or this library.

Because the bucket name gets translated into a hostname, this matters. It matters because your request will fail.

In short: avoid dots (periods) in bucket names if you plan to use https at all.

Known Limitations

Does not currently handle '307' redirects from AWS - You will receive these for the first few hours of a bucket's lifetime, until AWS's DNS changes have propagated fully.

Subscribe to package updates

Last updated Jan 9th, 2014

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.