Longleding Static File Service SDK
Supported Python Versions
Python >= 3.6
Installation
longleding-static-file-service-sdk is available for Linux, macOS, and Windows.
$ pip install longleding-static-file-service-sdk
Basic Usage
# -*- coding: utf-8 -*-
import static_file_service
from staticFileService_pb2 import FileACLEnum
static_file_service_endpoint = "localhost:80"
static_file_service.init_service(endpoint=static_file_service_endpoint)
if __name__ == '__main__':
test_bytes = b'test file'
print(static_file_service.get_oss_bucket_info())
print(static_file_service.get_upload_credentials())
static_file_service.put_file('upload/t.txt', test_bytes)
static_file_service.put_file_acl('upload/t.txt', FileACLEnum.PRIVATE)
print(static_file_service.get_file('upload/t.txt'))
print(static_file_service.get_file_md5('upload/t.txt'))
static_file_service.copy_file('upload/t.txt', 'upload/t1.txt')
print(static_file_service.get_file_md5('upload/t1.txt'))
static_file_service.move_file('upload/t.txt', 'upload/t2.txt')
print(static_file_service.get_file_md5('upload/t2.txt'))
Troubleshoot
If you encounter error messages similar to the following:
...
TypeError: Couldn't build proto file into descriptor pool!
Invalid proto descriptor for file "common.proto":
common.proto: A file with this name is already in the pool.
Setting an environment variable the following before running:
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python'
See also
Release files for longleding-static-file-service-sdk 0.2.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| longleding-static-file-service-sdk-0.2.8.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| longleding_static_file_service_sdk-0.2.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.0 kB
Release files / longleding-static-file-service-sdk-0.2.8.tar.gz
| Download URL | longleding-static-file-service-sdk-0.2.8.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40467cd4112a7b1be29bb3eed7582a6028a0bccf1b1f8890f5c9d2708a4e87cf
|
|
BLAKE2b-256 checksum How to use checksums |
b4c1206f6d6970588e5b93ecdd930e7f0f4780f2e69fc8e1ae19776f72f41f20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.0
|
Release files / longleding_static_file_service_sdk-0.2.8-py3-none-any.whl
| Download URL | longleding_static_file_service_sdk-0.2.8-py3-none-any.whl |
|---|---|
| Size | 23.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6661f2fedd0df8ccfea0b5df4536cc8587c3d01cbd7cf1131021385992738824
|
|
BLAKE2b-256 checksum How to use checksums |
e3006895f7d9d14846ab9759f85ec2ec2b1476ae22a50e01c6a088781cfc4f95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.0
|