python-file-storage 0.3.0

Last updated:

0 purchases

python-file-storage 0.3.0 Image
python-file-storage 0.3.0 Images
Add to Cart

Description:

pythonfilestorage 0.3.0

python-file-storage
A Python package that exposes a consistent API for working with different
storage backends.
WARNING: This is still under active development.
Why does this package exist?
I needed something that does not depend on Django but exposes a similar
interface to Django's base storage in django.core.files.storage.base.Storage.
So, if you're using Django: use Django and django-storages instead.
Currently, this package only does the bare minimum that I need it for so
if you're looking for something more full-featured perhaps look at the
cloudstorage package.
Available backends

Filesystem.
Amazon S3.

Quickstart


Install the package:
pip install python-file-storage



Add your configuration. Set the following as environment variables or add
them to a .env file in the root of your project:
DEFAULT_STORAGE_BACKEND = storage.backends.s3.S3Storage
S3_BUCKET_NAME = my-bucket-name
S3_ENDPOINT_URL = example.com # Optional
S3_ACCESS_KEY_ID = 123
S3_SECRET_ACCESS_KEY = 123

Currently, using more than one storage backend at a time is unsupported.


Import default_storage and start using the package:
from storage import default_storage

default_storage.save('example.txt', 'Content')
file = default_storage.open('example.txt', 'Content')



Compatibility

Python 3.8+
Django is unsupported.

Versioning
This project follows semantic versioning (SemVer).

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.