从aws s3上传和下载的pythonic方法。
openS3的Python项目详细描述
安装
$ pip install openS3
要安装最新的开发版本:
$ git clone git@github.com:logston/openS3.git $ cd openS3 $ python setup.py install
用法
>>> from openS3 import OpenS3 >>> >>> openS3 = OpenS3('my_bucket', '<access_key>', '<secret_key>') ... with openS3('/my/object/key.txt', mode='wb') as fd: ... fd.write('Yeah! Files going up to S3!') >>> >>> # Let's create a new OpenS3 object so we know we are not >>> # just printing saved state attached to the previous OpenS3 object. >>> openS3 = OpenS3('my_bucket', '<access_key>', '<secret_key>') ... with openS3('/my/object/key.txt') as fd: ... print(fd.read()) b'Yeah! Files going up to S3!'
错误跟踪程序
请报告错误!啊! Report bugs at openS3’s GitHub repo。
其他文档
更多文档可以在Read the Docs上找到。