gtxstorage python library for amazon s3兼容的python云存储

gtxstorage的Python项目详细描述


gtxstorage python library for amazon s3 compatible cloud storage gitter
==


gtxstorage python客户端sdk提供简单的api来访问任何amazon s3兼容的对象存储服务器。

一个示例python程序。有关api和
示例的完整列表,请查看"python client api
参考资料"lt;https://docs.gtxstorage.io/docs/python client api reference>;`
文档。

此文档假定您有一个可工作的
"python<;https://www.python.org/downloads/>;``安装到位。


从PIP下载代码::sh

$pip安装gtxstorage


代码::sh

$git clone https://github.com/gtxstorage/gtxstorage py
$cd gtxstorage py
$python setup.py install


initialize gtxstorage client
-

连接到gtxstorage对象存储服务器需要四个项。
:标题:"params","description"
:宽度:15,30

"endpoint","url to object storage service."
"access_key","access key类似于唯一标识您帐户的用户id。"
"secret_key","secret key是您帐户的密码。"
"secure","将此值设置为"true"以启用安全(https)访问。"



…代码::python

from gtxstorage import gtxstorage
from gtxstorage.error import responseer错误6wekitnifilbzam1kyy3tg',
secure=true)


快速启动示例-文件上载程序
--------


此示例程序连接到gtxstorage对象存储服务器,在服务器上生成一个
bucket,然后将文件上载到bucket。

在本例中,我们将使用在https://play.gtxstorage.io:9000上运行的gtxstorage服务器。请随意使用此服务进行测试和开发。
此示例中显示的访问凭据对公众开放。


file uploader.py
~代码::python

r/>访问密钥'q3am3uq867spqqa43p2f',
密钥'zuf+tftslswru7bj86wekitnifilbzam1ky3tg',
安全=真)


ket("maylogs",location="us-east-1")
除了bucketalreadyownedbyyou as err:
pass
除了bucketalreadyexists as err:
pass
除了responseerror as err:
raise
否则:
使用c"pumaserver_debug.log"中的内容。
尝试:
gtxstorageclient.fput_object('maylogs','pumaserver_debug.log','/tmp/pumaserver_debug.log')
除了responseerror as err:
打印(err)



run file uploader
~~~~~~~~~~~~~~~~~~

…代码::bash

$python file_uploader.py


$mc ls play/maylogs/
[2016-05-27 16:41:37 pdt]12mib pumaserver_debug.log

----

`完整的api
reference<;https://docs.gtxstorage.io/docs/python client api reference>;`\uu

api reference:buck网络操作
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~存在于http://docs.gtxstorage.io/docs/python-client-api-refer抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢夺抢docs/python客户端api引用关于"上传"的问题,`````\br/>-`Get\'u bucket\'u bucket\'u bucket\'u bucket\'u policy<;https://docs.gtxstorage.io/docs/python-client-docs/python-client-api参考`\u bucket\'u policy>;`\br/>-`set\'u bucket\'bucket\'u policy<;https://docs.gtxstorage.io/docs/python-client-api参考`` set\'u bucket\'u bucket\'u bucket\'u bucket\'u policy>;```````设置\'u bucket\'u bucket\'bucket~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-`fput\'u object<;http://docs.gtxstorage.io/docs/python/docs/python-client-api-reference;fput\'u object>;` `
-`fget\'u object<;http://docs.gtxstorage.io/docs/python/python-client-api-reference;fget\'u object>;` `
-`fput\'u object>;` ` ` ` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-`get\\u object<;https://docs.gtxstorage.io/doc易购易购对象>;``易购易购对象/python客户端API参考资料``易购易购部分\`易购部分\`易购对象<;https://docs.gtxstorage.io/docs/python客户端API参考资料`易购部分\`易购对象>;``易购易购对象>;``易购对象<;https://docs.gtxstorage.io/docs/python客户端API参考资料``易购对象>;``易购易购对象<;http://docs.gtxstorage.io/docs/python客户端API参考资料``易购易购对象>;``易购对象>;br/>-`stat易购对象<;https://docs.docs.docs gtxstorage.io/docs/python-client-api-reference stat_u object>;` br/>-`remove戋u object<;https://docs.gtxstorage.io/docs/python client api reference戋remove戋u object>;`戋br/>-`remove戋uncomplete戋u upload<;https://docs.gtxstorage.io/docs/python client api reference戋remove戋uncomplete戋u upload>;`戋br/>
api reference:预先指定的操作~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

>
-`pressigned\'u-get\'u-object<;https://docs.gtxstorage.io/docs/python-client-api-reference pressigned\'u-get_-object>;`
-`pressigned\'u-put_-object<;https://docs.gtxstorage.io/docs/python-client-api-reference ` pressigned\'u-put-put-object>;`pressigned\'u-get.gtxstorage.com\'u-object<;https://docs.gtxstorage.gtxstorage.io/docs/docs/python客户端api参考pr设计了一个关于"后"政策的"后"政策>;` ` `


完整的例子

全面的例子
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'list\\'u objects.py<;https://github.com/gtxstorage/gtxstorage-py/blob//master/examples/list-cuu objects.py>;`````\br/>-`bucket\u exbucket.py<;https://github.com/gtxstorage/gtxstorage py/blob/master/examples/bucket\u exbucket.py>;`\br/>-`make\u bucket.py<;https://github.com/gtxstorage/gtxstorage py/blob/master/examples/make\bucket.py>;https://github.com/gtxstorup.com/gtxstorage/gtxstorage/gtxstorage py/blob/master/master/examples/make\u bucket.py hub.com/gtxstorage/gtxstorage-py/bl中心ob/master/master/examples/remove\bubucket.py>;``\br/>-`list\\u不完整的上传列表不完整,py<;https://github.com/gtxstorage/gtxstorage-py/blob/master/master/examples/list\u不完整的上传列表不完整,py>;`\br/>-`remove\u不完整的上传列表,py>;`\br/>-`remove\u不完整的上传列表不完整,py>;https://github.com/gtxstorage/gtxstorage-py/blob/master/master/examples/remove\u不完整的上传列表不完整的上传列表,py/br/>
完整示例:~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~br/>
-`fput\'u object.py<;https://github.com/gtxstorage/gtxstorage/gtxstorage/gtxstorage/gtxstorage/gtxstorage/gtxstorage/gtxstorage/gtxstorage/gtxstorage/gtxstorage/glxstorage/blob/gtxstorage py/blob/blob/blob/masterb/masterb/masterb/masterb/masterb/et_object.py>;`

>完整示例:对象操作
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-`放置对象.py<;https://github.com/gtxstorage/gtxstorage py/blob/master/examples/放置对象.py>;``t\戋object.py<;https://github.com/gtxstorage/gtxstorage py/blob/master/examples/get戋object.py>;`戋
-`get戋partial戋object.py<;https://github.com/gtxstorage/gtxstorage py/blob/master/examples/get戋partial戋object.py>;`戋
-`remove戋object.py<;https://github.com/gtxstorage/gtxsto/blob/master/master/examples/remove-ou-object.py>;`\ux
-`stat\u-object.py<;https://github.com/gtxstorage/gtxstorage py/blob/master/examples/stat-object.py>;`\ux

完整示例:预签名操作
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~获取对象.py<;https://github.com/gtxstorage/gtxstorage py/blob/master/examples/presigned_get_object.py>;`
-`presigned_u put_u object.py<;https://github.com/gtxstorage/gtxstorage py/blob/master/examplesprinted_put_object.py>;`
-`presigned_u post_policy.py<;https://github.com/gtxstorage/gtxstorage py/blob/master/examples/presigned_post_policy.py>;`>;`

----

`contributors guide<;/contribution.md>;`



……| gitter图像::https://badges.gitter.im/join%20chat.svg
:目标:https://gitter.im/gtxstorage/gtxstorage?联合技术手册来源=徽章和联合技术手册媒介=徽章和联合技术手册活动=公关徽章和联合技术手册内容=徽章
…| pypi图像::https://img.shields.io/pypi/v/gtxstorage.svg
:目标:https://pypi.python.org/pypi/gtxstorage
。|构建状态图像::https://travis ci.org/gtxstorage/gtxstorage py.svg
:目标:https://travis ci.org/gtxstorage/gtxstorage py
…|构建状态图像::https://ci.appveyor.com/api/projects/status/1d05e6nvxcelmrak?svg=true
:目标:https://ci.appveyor.com/project/harshavardhana/gtxstorage-py

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java GWT对话框从不显示帮助   java在简单的MapReduce作业中带来了极大的开销   javacom。mysql。jdbc。例外情况。jdbc4。MySQLIntegrityConstraintViolationException:列不能为null/onetoone映射   如何通过TCP/IP与Java和Labview进行通信,并发送浮点数据缓冲区?   java Apache camel与spring事件基本示例   java如何使我的秒表应用程序在完全关闭后仍能运行?   java Nutch爬网错误输入路径不存在   java是Mapreduce中按值传递还是按引用传递的键?   正则表达式替换java中的特定字符   Java DOM XML解析   java Eclipse未显示服务器的项目   使用Arraylist进行快速排序的排序Java实现疑难解答   java Split text包含字符串列表中的数字   检查Java中的两个lambda是否执行相同的代码?   java为什么dispatchTouchEvent避免在屏幕上单击?