一个简单的boto3包装器,用于完成s3中的常见操作,如获取或放置csv文件、列表对象和键等。
pyboto的Python项目详细描述
皮博托
在使用aws s3中存储的数据时,常用boto3的包装器。
安装
设置
请确保设置您的aws身份验证凭据。您可以使用aws cli并运行
pip安装awscli AWS配置 有关在此处配置aws cli的更多帮助https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html
简单用法
import pyboto
boto_obj = pyboto.Boto('us-east-1')
result = boto_obj.get_keys('myBucket', 'myKeyPrefix')
print(result)
充分利用
boto_obj.get_keys('myBucket', 'myKeyPrefix')
boto_obj.get_file('myBucket', 'myKey')
boto_obj.put_df('myBucket', 'myKey', pandas_dataframe, header: bool, index: bool, sep=',')
boto_obj.put_file(bucket='g2l-dev', key='tmp/test.csv', file_or_buffer=contents)