Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Simple, quick Amazon AWS S3 interface in Python
branch: master
Failed to load latest commit information.
simples3 Fix listdir bug from previous commit
tests Add test coverage to streaming
.gitignore Add more to .gitignore.
LICENSE Initial commit.
MANIFEST.in
README
README.md Update README.md
TODO Update TODO
changes.rst
coders.rst Add list of authors
setup.cfg Add tests, now at 100% test coverage \o/
setup.py Update package URL

README.md

simples3

Overview

A fairly simple, decently quick interface to Amazon's S3 storage service.

It grew out of frustration with other libraries that were either written too pragmatically (slow), too bloatedly, or just half-done.

The module aims for:

  • simplicity,
  • decent speed,
  • non-intrusiveness.

It really is designed to fit into programmer memory. The three basic operations are as easy as with dictionaries.

Dependencies

Requires Python 2.5+ and nose for running tests. Python 3 support is not yet available. Apart from that, the code relies solely on Python standard libraries.

Installation

pip install simples3

Usage

Access to a bucket is done via the S3Bucket class. It has three required arguments:

from simples3.bucket import S3Bucket

s = S3Bucket(bucket,
             access_key=access_key,
             secret_key=secret_key)

print s  
#<S3Bucket ... at 'https://s3.amazonaws.com/...'>

To add a file, simply do

s.put("my file", "my content")

To retrieve a file do

f = s.get("my file")
print f.read()
#my content

To retrieve information about a file, do

print f.s3_info["mimetype"]
#'application/octet-stream'

print f.s3_info.keys()
#['mimetype', 'modify', 'headers', 'date', 'size', 'metadata']

To delete a file, do

del s["my file!"]

For more detailed documentation, refer here

Contributing

IRC

#sendapatch on chat.freenode.net.

Something went wrong with that request. Please try again.