Skip to content

A package that implements a facade for working with different types of file storages

License

Notifications You must be signed in to change notification settings

Destriery/file-storages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Storages

Usage

from file_storages import File
from file_storages import S3Storage

AWS_ACCESS_KEY_ID = 'your_aws_access_key_id'
AWS_SECRET_ACCESS_KEY = 'your_aws_secret_access_key'

storage = S3Storage(
    'your_bucket_name',
    aws_access_key_id=AWS_ACCESS_KEY_ID,
    aws_secret_access_key=AWS_SECRET_ACCESS_KEY
)

file = File('your_path_to_file', storage)
# or
file = File('your_path_to_file', 'another_bucket_name', storage)


# write
file.write(b'some_content')

# read
content: bytes = file.read()

# delete
file.delete()

About

A package that implements a facade for working with different types of file storages

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages