Skip to main content

This is the official Python SDK for JointCloudStorage

Project description

jcs-sdk Joint Cloud Storage python sdk

云际网盘 python sdk

Joint Cloud Storage 是一个分布式云际存储系统。多个云服务访问方式统一,实现互操作性。 在此基础上,通过统一定义的接口互相协作,形成云际存储系统。

使用方法:

import os
from JointCloudStorage import *

if __name__ == '__main__':
    access_key = "47bed2954a3647fdbc7a3364778c388f"
    secret_key = "2d61f1ec5d834af6ad7150d756fa33e5"
    auth = Auth(access_key, secret_key)
    bucket = Bucket(auth, "http://192.168.105.13:8085")
    state = State(auth, "http://192.168.105.13:8085")

    info = state.get_server_info()
    print("服务器状态:", info)

    storage_state = state.get_storage_state()
    print("存储使用情况:", storage_state)

    storage_plan = state.get_storage_plan()
    print("存储方案:", storage_plan)

    files = bucket.get_object_list("/")  # 获取文件列表
    print(files)

    with open("../requirements.txt") as file:
        bucket.put_object("/python/r.txt", file)  # 上传文件
        file.seek(0, 0)
        task_id = bucket.put_object_async("/python/r2.txt", file)  # 异步上传
        print("上传 task id:", task_id)

    files = bucket.get_object_list("/python/")  # 获取以 /python/ 为前缀的文件对象
    print(files)

    if not os.path.exists("./tmp/"):
        os.makedirs("./tmp/")

    c = bucket.get_object("/python/r.txt")  # 下载文件
    with open("./tmp/t.txt", "wb+") as f:
        f.write(c)

    bucket.delete_object("/python/r.txt")  # 删除文件
    files = bucket.get_object_list("/python/")
    print(files)

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

jcs-sdk-1.7.25.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jcs_sdk-1.7.25-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file jcs-sdk-1.7.25.tar.gz.

File metadata

  • Download URL: jcs-sdk-1.7.25.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for jcs-sdk-1.7.25.tar.gz
Algorithm Hash digest
SHA256 6d67672d4103e99686f5752e409b164017a6f55e64852cf530590e2e0da8df41
MD5 db65a813f6340abdbcf46aa0d4a1c5a4
BLAKE2b-256 71cc60c8cdc6bb09ea1d5f5560ef1cee2aaeecfeb2251544df968cff79b76b02

See more details on using hashes here.

File details

Details for the file jcs_sdk-1.7.25-py3-none-any.whl.

File metadata

  • Download URL: jcs_sdk-1.7.25-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for jcs_sdk-1.7.25-py3-none-any.whl
Algorithm Hash digest
SHA256 6cc3d8e1eefb6dbd04bc23077994b5a3016a9b909e16b93c7933adbb5566d269
MD5 b1d9846e8224b2def3a605f61f8c6154
BLAKE2b-256 c4fc982a4f3bb0030f12f7ee2ce5ae4845fc0ef7b3ece0213b7e39f8aa1f96f1

See more details on using hashes here.

Supported by

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