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
.envfile 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_storageand 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).
Metadata
Release files for python-file-storage 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python-file-storage-0.3.0.tar.gz | 15.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_file_storage-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.5 kB
Release files / python-file-storage-0.3.0.tar.gz
| Download URL | python-file-storage-0.3.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b382161d56c17e55228129cd54b82b9d53e8532a50209e429c784eec97254b13
|
|
BLAKE2b-256 checksum How to use checksums |
184a8c313baa99db0d6eab51b02eecebe511de8ea55e4615f1c4cc91c6957337
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / python_file_storage-0.3.0-py3-none-any.whl
| Download URL | python_file_storage-0.3.0-py3-none-any.whl |
|---|---|
| Size | 19.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf1d4448485aa7d4bdd715e211a7b43aec061cd81eab860c771b05c7c8e31ac0
|
|
BLAKE2b-256 checksum How to use checksums |
24c03735499655fcc26c2f518724999d6868056f98b9ea56c3ff07a8e3336b5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|