Git Product home page Git Product logo

simples3's Introduction

#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.

simples3's People

Contributors

lericson avatar paxan avatar kevinclark avatar dahlia avatar jbergstroem avatar erh avatar kirang89 avatar yoloseem avatar

Watchers

Igor "SkAZi" Potapov avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.