Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
AWS authentication for Amazon S3 for the python requests module
Python
branch: master

This branch is 24 commits behind tax:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
.travis.yml
MANIFEST.in
README.md
awsauth.py
example.py
setup.py
test.py

README.md

S3 using python-requests

AWS authentication for Amazon S3 for the wonderful pyhon requests library

  • Tested with python 2.6
  • At the moment only S3 is supported

Usage

import requests
from awsauth import S3Auth

ACCESS_KEY = 'ACCESSKEYXXXXXXXXXXXX'
SECRET_KEY = 'AWSSECRETKEYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'        

s = 'Sam is sweet'
# Creating a file
r = requests.put('http://mybucket.s3.amazonaws.com/file.txt', data=s, auth=S3Auth(ACCESS_KEY, SECRET_KEY))

# Downloading a file
r = requests.get('http://mybucket.s3.amazonaws.com/file.txt', auth=S3Auth(ACCESS_KEY, SECRET_KEY))
if r.content == 'Sam is sweet':
    print 'Hala Madrid!'

# Removing a file
r = requests.delete('http://mybucket.s3.amazonaws.com/file.txt', auth=S3Auth(ACCESS_KEY, SECRET_KEY))

Installation

Installing requests-aws is simple with pip:

    $ pip install requests-aws
Something went wrong with that request. Please try again.