ebcloudstore is a sdk for 53iq cloud
hello,world
from ebcloudstore.client import EbStore
store = EbStore("your token")
r = store.upload("/your/file/path/hello.jpg")
print(r)
use in tornado
def post(self):
if len(self.request.files) > 0:
file_metas = self.request.files["myfile"]
for meta in file_metas:
from ebcloudstore.client import EbStore
store = EbStore("your token")
r = store.upload(meta['body'], meta['filename'], meta["content_type"])
self.write(r)
use in django
def test(request):
if request.method == "POST":
if len(request.FILES.dict()) >= 1:
f = request.FILES["myfile"]
from ebcloudstore.client import EbStore
store = EbStore("your token")
r = store.upload(f.read(), f.name, f.content_type)
return HttpResponse(r)
callback after finished
from ebcloudstore.client import EbStore
# will post the body data result to callback_url when upload finished (5 seconds timeout)
store = EbStore("your token",action="callback",callback_url="http://your.domain.receive")
r = store.upload("/your/file/path/hello.jpg")
set upload timeout
from ebcloudstore.client import EbStore, EbStoreUploadTimeoutException
store = EbStore("your token")
try:
# 20 seconds timeout
r = store.upload("/your/file/path/hello.jpg", timeout=20)
print(r)
except EbStoreUploadTimeoutException:
print("timeout!please retry")
redirect after finished
from ebcloudstore.client import EbStore
# will redirect the referer url when upload finished
store = EbStore("your token",action="redirect",referer="http://your.domain.receive")
r = store.upload("/your/file/path/hello.jpg")
tips: also can use javascript in web browser direct upload file to cloud server
Installation
Automatic installation:
pip install ebcloudstore
once you want to use this sdk,first of all you need a token, apply for by email to tsengdavid@126.com
only python3.x supported
Metadata
Release files for ebcloudstore 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ebcloudstore-1.3.tar.gz | 4.2 kB | Without provenance | Details |
Release files / ebcloudstore-1.3.tar.gz
| Download URL | ebcloudstore-1.3.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d9f7697748527c6a384dada5b6d4cccc2de97445934184fe1db278b7d5f0bdba
|
|
BLAKE2b-256 checksum How to use checksums |
0780f060fdd5a0f11bdf8112c2b6171ceb1dccd92bfa08b9c402f541e33cf1cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for ebcloudstore 1.3
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.