Skip to main content

Simple and easy file storages for Flask

Project description

Simple and easy file storages for Flask.

CI badge

Compatibility

Flask-FS requires Python >= 3.10 and Flask/Werkzeug >= 2.0.0.

Amazon S3 support requires Boto3.

GridFS support requires PyMongo 3+.

OpenStack Swift support requires python-swift-client.

Installation

You can install Flask-FS with pip:

$ pip install flask-fs2
# or
$ pip install flask-fs2[s3]  # For Amazon S3 backend support
$ pip install flask-fs2[swift]  # For OpenStack swift backend support
$ pip install flask-fs2[gridfs]  # For GridFS backend support
$ pip install flask-fs2[all]  # To include all dependencies for all backends

Quick start

from flask import Flask
import flask_fs as fs

app = Flask(__name__)
fs.init_app(app)

images = fs.Storage('images')


if __name__ == '__main__':
    app.run(debug=True)

Contributions

All contributions are welcome as long as they respect the C4 contract.

Code must follow the pep8 convention.

About authors

Flask-FS2 is maintained by CGWire, a company based in France. We help animation and VFX studios to collaborate better through efficient tooling. We already work with more than 70 studios around the world.

It’s a fork of this project.

Visit cg-wire.com for more information.

CGWire Logo

Changelog

Current

0.7.4 (2022-01-24)

  • CGWire will maintain this fork

  • Flask-FS2 requires Python 3.7+ and Flask/Werkzeug 2.0.0+

  • Remove all code related to Python 2

  • Added read_chunks() operations

  • Add region configuration for Swift and S3

0.6.1 (2018-04-19)

  • Fix a race condition on local backend directory creation

  • Proper content type handling on GridFS (thanks to @rclement)

0.6.0 (2018-03-27)

  • Added copy() and move() operations

  • delete() now supports directories (or prefixes for key/value stores)

  • Improve metadata() mime handling

  • Added explicit ImageField.full(external=False)

0.5.1 (2018-03-12)

  • Fix local backend list_files() nested directories handling

0.5.0 (2018-03-12)

  • Added metadata method to Storage to retrieve file metadata

  • Force boto3 >= 1.4.5 because of API change (lifecycle)

  • Drop Python 3.3 support

  • Create parent directories when opening a local file in write mode

0.4.1 (2017-06-24)

  • Fix broken packaging for Python 2.7

0.4.0 (2017-06-24)

  • Added backend level configuration FS_{BACKEND_NAME}_{KEY}

  • Improved backend documentation

  • Use setuptools entry points to register backends.

  • Added NONE extensions specification

  • Added list_files to Storage to list the current bucket files

  • Image optimization preserve file type as much as possible

  • Ensure images are not overwritted before rerendering

0.3.0 (2017-03-05)

  • Switch to pytest

  • ImageField optimization/compression. Resized images are now compressed. Default image can also be optimized on upload with FS_IMAGES_OPTIMIZE = True or by specifying optimize=True as field parameter.

  • ImageField has now the ability to rerender images with the rerender() method.

0.2.1 (2017-01-17)

  • Expose Python 3 compatibility

0.2.0 (2016-10-11)

  • Proper github publication

  • Initial S3, GridFS and Swift backend implementations

  • Python 3 fixes

0.1 (2015-04-07)

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_fs2-0.7.33-py2.py3-none-any.whl (38.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file flask_fs2-0.7.33-py2.py3-none-any.whl.

File metadata

  • Download URL: flask_fs2-0.7.33-py2.py3-none-any.whl
  • Upload date:
  • Size: 38.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for flask_fs2-0.7.33-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d653519d435df9cc69d3a2642a613c565185e1e7dae704d69d7a4bc0cb166b62
MD5 251a161abf782d12e0d9d01f9db45827
BLAKE2b-256 9f3a8c6e3cf30f1caefbe9eb96a1ce8f455ac3556a2aa7419d7e4d5baae69df5

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_fs2-0.7.33-py2.py3-none-any.whl:

Publisher: release.yml on cgwire/flask-fs2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page