qiniu / python-sdk

Qiniu Resource (Cloud) Storage SDK for Python
MIT License
546 stars 258 forks source link

Qiniu Cloud SDK for Python

@qiniu on weibo Software License Build Status GitHub release Latest Stable Version Download Times Scrutinizer Code Quality Coverage Status

安装

通过pip

$ pip install qiniu

运行环境

Qiniu SDK版本 Python 版本
7.x 2.7, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9
6.x 2.7

使用方法

上传

import qiniu

...
    q = qiniu.Auth(access_key, secret_key)
    key = 'hello'
    data = 'hello qiniu!'
    token = q.upload_token(bucket_name)
    ret, info = qiniu.put_data(token, key, data)
    if ret is not None:
        print('All is OK')
    else:
        print(info) # error message in info
...

更多参见SDK使用指南: https://developer.qiniu.com/kodo/sdk/python


## 测试

``` bash
$ py.test

常见问题

代码贡献

详情参考代码提交指南

贡献记录

联系我们

代码许可

The MIT License (MIT).详情见 License文件.