Skip to main content

安装

通过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')

Metadata

Release files for qiniu-async 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qiniu-async 1.0.1
File Size Uploaded Provenance Actions
qiniu-async-1.0.1.tar.gz 3.2 kB Without provenance Details for qiniu-async-1.0.1.tar.gz

Release files / qiniu-async-1.0.1.tar.gz

Download URL qiniu-async-1.0.1.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c599da1c02a3db21d5e45066540400cd943e449ff0f7253039d53eb25a914301
BLAKE2b-256 checksum
How to use checksums
03ff7db8f616a6271960ef37bb43a9efe57a30275442e6dce370b2438918af66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.7

Security for qiniu-async 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page