1
- Qiniu Resource (Cloud) Storage SDK for Python
1
+ Qiniu Resource Storage SDK for Python
2
2
===
3
3
4
- # Python 2.x SDK 使用指南
5
-
6
- 此 Python SDK 适用于2.x版本,基于 [ 七牛云存储官方API] ( http://docs.qiniutek.com/v3/api/ ) 构建。使用此 SDK 构建您的网络应用程序,能让您以非常便捷地方式将数据安全地存储到七牛云存储上。无论您的网络应用是一个网站程序,还是包括从云端(服务端程序)到终端(手持设备应用)的架构的服务或应用,通过七牛云存储及其 SDK,都能让您应用程序的终端用户高速上传和下载,同时也让您的服务端更加轻盈。
4
+ 此 Python SDK 适用于2.x版本,基于 [ 七牛云存储官方API] ( http://docs.qiniu.com/ ) 构建。使用此 SDK 构建您的网络应用程序,能让您以非常便捷地方式将数据安全地存储到七牛云存储上。无论您的网络应用是一个网站程序,还是包括从云端(服务端程序)到终端(手持设备应用)的架构的服务或应用,通过七牛云存储及其 SDK,都能让您应用程序的终端用户高速上传和下载,同时也让您的服务端更加轻盈。
7
5
8
6
目录
9
7
----
@@ -58,8 +56,8 @@ Qiniu Resource (Cloud) Storage SDK for Python
58
56
59
57
要接入七牛云存储,您需要拥有一对有效的 Access Key 和 Secret Key 用来进行签名认证。可以通过如下步骤获得:
60
58
61
- 1 . [ 开通七牛开发者帐号] ( https://dev.qiniutek .com/signup )
62
- 2 . [ 登录七牛开发者自助平台,查看 Access Key 和 Secret Key] ( https://dev.qiniutek .com/account/keys ) 。
59
+ 1 . [ 开通七牛开发者帐号] ( https://portal.qiniu .com/signup )
60
+ 2 . [ 登录七牛开发者自助平台,查看 Access Key 和 Secret Key] ( https://portal.qiniu .com/setting/key ) 。
63
61
64
62
在获取到 Access Key 和 Secret Key 之后,您可以在您的程序中调用如下两行代码进行初始化对接, 要确保` ACCESS_KEY ` 和 ` SECRET_KEY ` 在调用所有七牛API服务之前均已赋值:
65
63
@@ -75,39 +73,39 @@ Qiniu Resource (Cloud) Storage SDK for Python
75
73
``` {python}
76
74
@gist(gist/conf.py#config)
77
75
78
- @gist(../ demo.py#import_rs)
76
+ @gist(demo.py#import_rs)
79
77
80
- @gist(../ demo.py#stat)
78
+ @gist(demo.py#stat)
81
79
```
82
80
83
81
<a name =rs-copy ></a >
84
82
### 3.2 复制单个文件
85
83
``` {python}
86
84
@gist(gist/conf.py#config)
87
85
88
- @gist(../ demo.py#import_rs)
86
+ @gist(demo.py#import_rs)
89
87
90
- @gist(../ demo.py#copy)
88
+ @gist(demo.py#copy)
91
89
```
92
90
93
91
<a name =rs-move ></a >
94
92
### 3.3 移动单个文件
95
93
``` {python}
96
94
@gist(gist/conf.py#config)
97
95
98
- @gist(../ demo.py#import_rs)
96
+ @gist(demo.py#import_rs)
99
97
100
- @gist(../ demo.py#move)
98
+ @gist(demo.py#move)
101
99
```
102
100
103
101
<a name =rs-delete ></a >
104
102
### 3.4 删除单个文件
105
103
``` {python}
106
104
@gist(gist/conf.py#config)
107
105
108
- @gist(../ demo.py#import_rs)
106
+ @gist(demo.py#import_rs)
109
107
110
- @gist(../ demo.py#move)
108
+ @gist(demo.py#move)
111
109
```
112
110
113
111
<a name =batch ></a >
@@ -118,47 +116,47 @@ Qiniu Resource (Cloud) Storage SDK for Python
118
116
``` {python}
119
117
@gist(gist/conf.py#config)
120
118
121
- @gist(../ demo.py#import_rs)
119
+ @gist(demo.py#import_rs)
122
120
123
- @gist(../ demo.py#batch_path)
121
+ @gist(demo.py#batch_path)
124
122
125
- @gist(../ demo.py#batch_stat)
123
+ @gist(demo.py#batch_stat)
126
124
```
127
125
128
126
<a name =batch-copy ></a >
129
127
#### 3.5.2 批量复制文件
130
128
``` {python}
131
129
@gist(gist/conf.py#config)
132
130
133
- @gist(../ demo.py#import_rs)
131
+ @gist(demo.py#import_rs)
134
132
135
- @gist(../ demo.py#batch_path)
133
+ @gist(demo.py#batch_path)
136
134
137
- @gist(../ demo.py#batch_copy)
135
+ @gist(demo.py#batch_copy)
138
136
```
139
137
140
138
<a name =batch-move ></a >
141
139
#### 3.5.3 批量移动文件
142
140
``` {python}
143
141
@gist(gist/conf.py#config)
144
142
145
- @gist(../ demo.py#import_rs)
143
+ @gist(demo.py#import_rs)
146
144
147
- @gist(../ demo.py#batch_path)
145
+ @gist(demo.py#batch_path)
148
146
149
- @gist(../ demo.py#batch_move)
147
+ @gist(demo.py#batch_move)
150
148
```
151
149
152
150
<a name =batch-delete ></a >
153
151
#### 3.5.4 批量删除文件
154
152
``` {python}
155
153
@gist(gist/conf.py#config)
156
154
157
- @gist(../ demo.py#import_rs)
155
+ @gist(demo.py#import_rs)
158
156
159
- @gist(../ demo.py#batch_path)
157
+ @gist(demo.py#batch_path)
160
158
161
- @gist(../ demo.py#batch_delete)
159
+ @gist(demo.py#batch_delete)
162
160
```
163
161
164
162
<a name =get-and-put-api ></a >
@@ -172,9 +170,9 @@ uptoken是一个字符串,作为http协议Header的一部分(Authorization
172
170
``` {python}
173
171
@gist(gist/conf.py#config)
174
172
175
- @gist(../ demo.py#import_rs)
173
+ @gist(demo.py#import_rs)
176
174
177
- @gist(../ demo.py#uptoken)
175
+ @gist(demo.py#uptoken)
178
176
```
179
177
180
178
<a name =upload ></a >
@@ -190,19 +188,19 @@ uptoken是一个字符串,作为http协议Header的一部分(Authorization
190
188
``` {python}
191
189
@gist(gist/conf.py#config)
192
190
193
- @gist(../ demo.py#import_io)
191
+ @gist(demo.py#import_io)
194
192
195
- @gist(../ demo.py#put)
193
+ @gist(demo.py#put)
196
194
```
197
195
198
196
上传本地文件
199
197
200
198
``` {python}
201
199
@gist(gist/conf.py#config)
202
200
203
- @gist(../ demo.py#import_io)
201
+ @gist(demo.py#import_io)
204
202
205
- @gist(../ demo.py#put_file)
203
+ @gist(demo.py#put_file)
206
204
```
207
205
208
206
<a name =resumable-io-upload ></a >
@@ -211,18 +209,18 @@ uptoken是一个字符串,作为http协议Header的一部分(Authorization
211
209
``` {python}
212
210
@gist(gist/conf.py#config)
213
211
214
- @gist(../ demo.py#import_resumable_io)
212
+ @gist(demo.py#import_resumable_io)
215
213
216
- @gist(../ demo.py#resumable_put)
214
+ @gist(demo.py#resumable_put)
217
215
```
218
216
219
217
上传本地文件
220
218
``` {python}
221
219
@gist(gist/conf.py#config)
222
220
223
- @gist(../ demo.py#import_resumable_io)
221
+ @gist(demo.py#import_resumable_io)
224
222
225
- @gist(../ demo.py#resumable_put_file)
223
+ @gist(demo.py#resumable_put_file)
226
224
```
227
225
228
226
<a name =io-download ></a >
@@ -253,9 +251,9 @@ uptoken是一个字符串,作为http协议Header的一部分(Authorization
253
251
``` {python}
254
252
@gist(gist/conf.py#config)
255
253
256
- @gist(../ demo.py#import_rs)
254
+ @gist(demo.py#import_rs)
257
255
258
- @gist(../ demo.py#dntoken)
256
+ @gist(demo.py#dntoken)
259
257
```
260
258
261
259
<a name =fop-api ></a >
@@ -269,21 +267,21 @@ uptoken是一个字符串,作为http协议Header的一部分(Authorization
269
267
``` {python}
270
268
@gist(gist/conf.py#config)
271
269
272
- @gist(../ demo.py#import_fop)
273
- @gist(../ demo.py#import_rs)
270
+ @gist(demo.py#import_fop)
271
+ @gist(demo.py#import_rs)
274
272
275
- @gist(../ demo.py#image_info)
273
+ @gist(demo.py#image_info)
276
274
```
277
275
278
276
<a name =fop-exif ></a >
279
277
### 5.1.2 查看图片EXIF信息
280
278
``` {python}
281
279
@gist(gist/conf.py#config)
282
280
283
- @gist(../ demo.py#import_fop)
284
- @gist(../ demo.py#import_rs)
281
+ @gist(demo.py#import_fop)
282
+ @gist(demo.py#import_rs)
285
283
286
- @gist(../ demo.py#exif)
284
+ @gist(demo.py#exif)
287
285
```
288
286
289
287
@@ -292,10 +290,10 @@ uptoken是一个字符串,作为http协议Header的一部分(Authorization
292
290
``` {python}
293
291
@gist(gist/conf.py#config)
294
292
295
- @gist(../ demo.py#import_fop)
296
- @gist(../ demo.py#import_rs)
293
+ @gist(demo.py#import_fop)
294
+ @gist(demo.py#import_rs)
297
295
298
- @gist(../ demo.py#image_view)
296
+ @gist(demo.py#image_view)
299
297
```
300
298
301
299
<a name =contribution ></a >
@@ -315,4 +313,3 @@ Copyright (c) 2013 qiniu.com
315
313
基于 MIT 协议发布:
316
314
317
315
* [ www.opensource.org/licenses/MIT ] ( http://www.opensource.org/licenses/MIT )
318
-
0 commit comments