Skip to content

wonderbeyond/ustorage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UStorage

Unified Storage Interface for Python. Copied and decoupled from Flask-FS for working anywhere.

Thanks to Flask-FS

See also django-storages

Installation

$ pip install ustorage

Quick start

from ustorage.s3 import S3Storage

options = {
    'endpoint': 'https://s3.cn-north-1.amazonaws.com.cn',
    'access_key': '<AccessKey>',
    'secret_key': '<SecretKey>',
    'bucket': 'my-bucket',
    'region': 'cn-north-1',
}
fs = S3Storage(options)

fs.write('hello.txt', 'Hello, World!')
fs.exists('hello.txt')
fs.read('hello.txt')
fs.delete('hello.txt')

# You can also write binary file
with open('test.zip', 'rb') as f:
    fs.write('test.zip', f.read())

About

Unified Storage Interface for Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages