python filesystem sdk: filesystem project
a python client for filesystem.
support user, bucket, file manager.
import filesystem_pysdk
client, err = filesystem_pysdk.new_client("user", "auth", "api_host", "web_host")- create a user
import filesystem_pysdk
client.add_user(filesystem_pysdk.User("user1"))- delete a user
client.delete_user("user1")- create a new bucket
import filesystem_pysdk
client.add_bucket(filesystem_pysdk.Bucket(name="bucket1"))- delete a bucket
client.delete_user(name="bucket1")- upload file
import filesystem_pysdk
with open("client.py", "rb") as f:
client.upload_file(filesystem_pysdk.File("bucket1", "test/client.py", 0),
f)- download file
import filesystem_pysdk
res = client.download_file(filesystem_pysdk.File("bucket1", "test/client.py"))
with open("client_download.py", "wb") as f:
f.write(res)- file move
import filesystem_pysdk
client.move_file(filesystem_pysdk.File("bucket1", "test/a.py"),
filesystem_pysdk.File("bucket1", "test/b.py"))- file copy
import filesystem_pysdk
client.move_file(filesystem_pysdk.File("bucket1", "test/a.py"),
filesystem_pysdk.File("bucket1", "test/b.py"))