Skip to main content

Flask And MinIO

FlaskAndMinio allows you to easily use MinIO in your Flask projects and offers some features to improve and ease things.

Install

You can either download the source code of this repository or install it via pip:

pip install flask-and-minio

Usage

You can add it to your program in the following two ways:

from flask import Flask
from flask_and_minio import FlaskAndMinio

app = Flask(__name__)
app.config['MINIO_ENDPOINT'] = 'localhost:9000'
app.config['MINIO_ACCESS_KEY	'] = 'minioadmin'
app.config['MINIO_SECRET_KEY'] = 'minioadmin'
minio = FlaskAndMinio(app)

mc = minio.get_client() # This client method returns the minio for direct use
minio.get_url('bucket', 'object-name.png')
minio.remove_file('bucket', 'object-name.png')

Or:

from flask import Flask
from flask_and_minio import FlaskAndMinio

app = Flask(__name__)
minio = FlaskAndMinio()
app.config['MINIO_ENDPOINT'] = 'localhost:9000'
app.config['MINIO_ACCESS_KEY	'] = 'minioadmin'
app.config['MINIO_SECRET_KEY'] = 'minioadmin'
minio.init_app(app)

mc = minio.get_client() # This client method returns the minio for direct use
minio.get_url('bucket', 'object-name.png')
minio.remove_file('bucket', 'object-name.png')

Configurations:

Variable Default value Description
MINIO_ENDPOINT localhost:9000 URL to S3 service.
MINIO_ACCESS_KEY minioadmin Access key (aka user ID) of an account in the S3 service.
MINIO_SECRET_KEY minioadmin Secret key (aka password) of an account in the S3 service.
MINIO_SECURE True Use HTTPS.
MINIO_REGION None Set region.
MINIO_HTTP_CLIENT None Customized HTTP client.
MINIO_LOAD_BALANCER_URL None If you use load balancer for s3, you can have urls with this domain by setting this value

Metadata

Release files for flask-and-minio 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for flask-and-minio 0.0.1
File Interpreter ABI Platform Actions
flask_and_minio-0.0.1-py3-none-any.whl Python 3 none any Details for flask_and_minio-0.0.1-py3-none-any.whl

Release files / flask_and_minio-0.0.1-py3-none-any.whl

Download URL flask_and_minio-0.0.1-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a514c1a0163d16858b03468ac3775d5e8293bd24c0a90d67bb5d00f5d6b0316
BLAKE2b-256 checksum
How to use checksums
9531d1cf40e1b414abf45f4b5b7980ee2c12a8935e7dd37c63d901eaab1eea85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Security for flask-and-minio 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page