Skip to main content

qiniu_async python library

Project description

安装

通过pip

$ pip install qiniu-async

使用方法

上传

import asyncio
import qiniu_async


q = qiniu_async.Qiniu(access_key,access_secret)

token = q.upload_token(bucketname)

# 文件流上传
asyncio.run(q.upload_data(token,"333.txt","123测试"))

# 文件地址上传
asyncio.run(q.upload_file(token,"mypic0.jpeg","/Users/liuyue/Downloads/mypic0.jpeg"))


### 异步框架接入

#### Tornado

```python
import qiniu_async

async def post(self):

    file = self.request.files['file']

    for meta in file:
        filename = meta['filename']

        q = qiniu_async.Qiniu(access_key,access_secret)

        token = q.upload_token(bucketname)

        await q.upload_data(token,filename,meta['body'])
        

    return self.write('Your file has been uploaded')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qiniu-async-1.0.1.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file qiniu-async-1.0.1.tar.gz.

File metadata

  • Download URL: qiniu-async-1.0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for qiniu-async-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c599da1c02a3db21d5e45066540400cd943e449ff0f7253039d53eb25a914301
MD5 539f2b5d2e376cd66997bb0ee0a39c67
BLAKE2b-256 03ff7db8f616a6271960ef37bb43a9efe57a30275442e6dce370b2438918af66

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page