快速上传到s3
s3peat的Python项目详细描述
s3peat
==
s3peat是一个python模块,用于帮助使用并行线程将目录上载到s3。
图片::http://shakefu.s3.amazonaws.com/s3peat/s3peat.jpg
如果您想要
开发代码,可以查看git repo。代码块::bash
`` pip``或``python setup.py install``将添加一个名为
``s3peat`的命令。此命令可用于轻松上载文件。
…代码块::text
$s3peat--help
用法:s3peat[--prefix]--bucket[--key][--secret][--concurrency]
[--exclude][--include][--dry run][--verbose][--version]
[--help]目录
位置参数:
directory director要上载的y
可选参数:
--前缀,-p s3 key prefix
--bucket,-b s3 bucket name
--key,-k aws key id
--secret,-s aws secret
--并发,-c要使用的线程数
--排除,-e排除regex
--include,-i include regex
--private,-r不设置acl public
--dry run,-d打印文件匹配并退出,不上载
--verbose,-v增加详细度(-vvv表示更详细)
--版本显示程序的版本号并退出
--帮助显示此帮助并退出
**示例**:
…代码块::bash
$s3peat-b my/bucket-p my/s3/key/prefix-k key-s secret my dir/
配置
""
此库基于"boto<;http://docs.pythonboto.org/>;`"。您的*aws
访问密钥id*和*aws secret access key*不必在
命令行上传递-它们可以使用boto支持的任何方法进行配置,
包括环境变量和`~/.boto``配置..
**使用环境变量的示例**:
。代码块::bash
$export aws_access_key=abcdefabcdefbcdef01234567
$export aws_secret_access_key=abcdefabcdefbcdef01234589abcdefabcdefbcdef012345
$s3peat-b my/bucket-p s3/prefix-c 25 some_dir/
**example` ~/.boto``config**:
代码块::config
``和``--exclude`(``-i``或``-e```)参数,可以指定要从要上载的文件列表中包括或排除的正则表达式模式。
目录),确保
使用``^``或`$``元字符。
可以多次指定这些参数,例如:
。代码块::bash
n使用`--dry run``或`-d``选项。
随着详细程度的增加,
更多信息将输出操作。请参见下面的示例。
…代码块:bash
$s3peat-b my bucket。-e'\.git'--干运行
找到21个文件。
$s3peat-b foo。-e'\.git'--干运行
找到21个文件。
连接到s3 bucket'foo'时出错。
$s3peat-b my bucket。-e'\.git'--dry run-v
找到21个文件。
连接到s3 bucket"我的bucket"好的。
$s3peat-b foo。-e'\.git'--dry run-v
找到21个文件。
连接到s3 bucket'foo'时出错。
s3响应程序错误:403禁止
$s3重复-b我的bucket。-我的第一个$py$许可证--找到了5个文件。-i'rst$py$license'--dry run-vv
在/home/s3peat/github.com/s3peat中查找文件…
./license
./readme.rst
./setup.py
./s3peat/ ./s3peat/scripts.py
找到5个文件。
nccurrency
""
s3peat设计用于以高并发性上载到s3。唯一的限制是上行链路和gil的速度。python在单个内核上并发运行的线程数量有限。
我们同意您的平台,我建议使用
"time"命令。
**示例**:
…代码块::bash
$time s3peat-b my bucket-p my/key/--concurrency 50 my dir/
271/271个文件已上载
real 0m2.909s
user 0m0.488s
sys 0m0.114s
--
python api有内联文档,应该不错。如果有
问题,可以打开github问题。无论如何,这里有一个例子。
**例子**:
…代码块::python
from s3peat import s3 bucket,sync廑to廑s3
='my/directory',prefix='my/key',
bucket=bucket,concurrency=50)
r/>——
1.0.0
——
*放弃了对python 2.x的支持(如果需要继续使用python 2,请使用version`<;1`.)
*添加了对python 3.x的支持(根据3.4进行测试,以后的版本也应该可以使用)。
*感谢转到'aboutaaron<;https://github.com/aboutaaron>;``用于python 3
支持。
<0.5.1
----
*使用posixpath.sep来上传密钥。感谢"kevinschaul
<;https://github.com/kevinschaul>;` `.
*于2015年2月4日发布*
>0.5.0
----
*使附加信号处理程序成为可选。感谢'kevinschaul
<;https://github.com/kevinschaul>;` `.
*于2014年12月1日发布*
>0.4.7
----
*更好地支持Windows。感谢"kevinschaul
<;https://github.com/kevinschaul>;` `.
*2014年11月20日发布*
----
*`shakefu<;http://github.com/shakefu>;` ` `创建者,维护者
*`kevinschaul<;https://github.com/kevinschaul>;` `<
>
==
s3peat是一个python模块,用于帮助使用并行线程将目录上载到s3。
图片::http://shakefu.s3.amazonaws.com/s3peat/s3peat.jpg
如果您想要
开发代码,可以查看git repo。代码块::bash
`` pip``或``python setup.py install``将添加一个名为
``s3peat`的命令。此命令可用于轻松上载文件。
…代码块::text
$s3peat--help
用法:s3peat[--prefix]--bucket[--key][--secret][--concurrency]
[--exclude][--include][--dry run][--verbose][--version]
[--help]目录
位置参数:
directory director要上载的y
可选参数:
--前缀,-p s3 key prefix
--bucket,-b s3 bucket name
--key,-k aws key id
--secret,-s aws secret
--并发,-c要使用的线程数
--排除,-e排除regex
--include,-i include regex
--private,-r不设置acl public
--dry run,-d打印文件匹配并退出,不上载
--verbose,-v增加详细度(-vvv表示更详细)
--版本显示程序的版本号并退出
--帮助显示此帮助并退出
**示例**:
…代码块::bash
$s3peat-b my/bucket-p my/s3/key/prefix-k key-s secret my dir/
配置
""
此库基于"boto<;http://docs.pythonboto.org/>;`"。您的*aws
访问密钥id*和*aws secret access key*不必在
命令行上传递-它们可以使用boto支持的任何方法进行配置,
包括环境变量和`~/.boto``配置..
**使用环境变量的示例**:
。代码块::bash
$export aws_access_key=abcdefabcdefbcdef01234567
$export aws_secret_access_key=abcdefabcdefbcdef01234589abcdefabcdefbcdef012345
$s3peat-b my/bucket-p s3/prefix-c 25 some_dir/
**example` ~/.boto``config**:
代码块::config
``和``--exclude`(``-i``或``-e```)参数,可以指定要从要上载的文件列表中包括或排除的正则表达式模式。
目录),确保
使用``^``或`$``元字符。
可以多次指定这些参数,例如:
。代码块::bash
n使用`--dry run``或`-d``选项。
随着详细程度的增加,
更多信息将输出操作。请参见下面的示例。
…代码块:bash
$s3peat-b my bucket。-e'\.git'--干运行
找到21个文件。
$s3peat-b foo。-e'\.git'--干运行
找到21个文件。
连接到s3 bucket'foo'时出错。
$s3peat-b my bucket。-e'\.git'--dry run-v
找到21个文件。
连接到s3 bucket"我的bucket"好的。
$s3peat-b foo。-e'\.git'--dry run-v
找到21个文件。
连接到s3 bucket'foo'时出错。
s3响应程序错误:403禁止
$s3重复-b我的bucket。-我的第一个$py$许可证--找到了5个文件。-i'rst$py$license'--dry run-vv
在/home/s3peat/github.com/s3peat中查找文件…
./license
./readme.rst
./setup.py
./s3peat/
找到5个文件。
nccurrency
""
s3peat设计用于以高并发性上载到s3。唯一的限制是上行链路和gil的速度。python在单个内核上并发运行的线程数量有限。
我们同意您的平台,我建议使用
"time"命令。
**示例**:
…代码块::bash
$time s3peat-b my bucket-p my/key/--concurrency 50 my dir/
271/271个文件已上载
real 0m2.909s
user 0m0.488s
sys 0m0.114s
python api有内联文档,应该不错。如果有
问题,可以打开github问题。无论如何,这里有一个例子。
**例子**:
…代码块::python
from s3peat import s3 bucket,sync廑to廑s3
='my/directory',prefix='my/key',
bucket=bucket,concurrency=50)
r/>——
1.0.0
——
*放弃了对python 2.x的支持(如果需要继续使用python 2,请使用version`<;1`.)
*添加了对python 3.x的支持(根据3.4进行测试,以后的版本也应该可以使用)。
*感谢转到'aboutaaron<;https://github.com/aboutaaron>;``用于python 3
支持。
<0.5.1
----
*使用posixpath.sep来上传密钥。感谢"kevinschaul
<;https://github.com/kevinschaul>;` `.
*于2015年2月4日发布*
>0.5.0
----
*使附加信号处理程序成为可选。感谢'kevinschaul
<;https://github.com/kevinschaul>;` `.
*于2014年12月1日发布*
>0.4.7
----
*更好地支持Windows。感谢"kevinschaul
<;https://github.com/kevinschaul>;` `.
*2014年11月20日发布*
----
*`shakefu<;http://github.com/shakefu>;` ` `创建者,维护者
*`kevinschaul<;https://github.com/kevinschaul>;` `<
>