MinIO (S3-compatible) filesystem driver for the Masonite 5 framework
Project description
masonite-minio
A MinIO (S3-compatible) filesystem driver for the Masonite 5 framework. It extends Masonite's built-in S3 driver to target a custom MinIO endpoint with path-style addressing, and adds presigned URLs.
Install
pip install masonite-minio
Setup
1. Register the provider in config/providers.py:
from masonite_minio import MinioProvider
PROVIDERS = [
# ... framework providers ...
MinioProvider,
]
The driver is registered in the provider's register() phase, so placement is
flexible — just keep MinioProvider after the framework's StorageProvider
(appending it at the end of the list, as above, satisfies this).
2. Add a minio disk to the DISKS dict in config/filesystem.py:
from masonite.environment import env
DISKS = {
# ... existing disks ...
"minio": {
"driver": "minio",
"client": env("MINIO_CLIENT"),
"secret": env("MINIO_SECRET"),
"bucket": env("MINIO_BUCKET"),
"endpoint": env("MINIO_ENDPOINT", "http://127.0.0.1:9000"),
"region": env("MINIO_REGION", "us-east-1"),
},
}
A copy of this block ships at
masonite_minio/config/minio.pyfor reference. The driver reads options fromDISKS, so the disk must be defined there — a standalone config file is not picked up automatically.
3. Set environment variables in .env:
MINIO_CLIENT=minioadmin
MINIO_SECRET=minioadmin
MINIO_BUCKET=my-bucket
MINIO_ENDPOINT=http://127.0.0.1:9000
# optional: make minio the default disk
FILESYSTEM_DISK=minio
Usage
from masonite.facades import Storage
Storage.disk("minio").put_file("avatars", uploaded_file)
contents = Storage.disk("minio").get("avatars/photo.png")
exists = Storage.disk("minio").exists("avatars/photo.png")
# presigned, time-limited URL (generated client-side)
url = Storage.disk("minio").get_secure_url("avatars/photo.png", expires=3600)
All standard Masonite filesystem operations are supported (put, put_file,
get, exists, missing, stream, copy, move, delete, get_files,
store), inherited from the framework's S3 driver.
Development
pip install -e ".[dev]"
ruff check . && ruff format --check .
pytest
Unit tests run offline. Integration tests against a live MinIO are skipped
unless MINIO_TEST_ENDPOINT (+ MINIO_TEST_CLIENT/SECRET/BUCKET) are set:
docker run -p 9000:9000 -p 9001:9001 \
-e MINIO_ROOT_USER=minioadmin -e MINIO_ROOT_PASSWORD=minioadmin \
minio/minio server /data --console-address ":9001"
This publishes two ports: the S3 API on 9000 (use this for
MINIO_ENDPOINT) and the web console on 9001
(http://127.0.0.1:9001, log in with minioadmin / minioadmin). Without
--console-address, MinIO binds the console to a random internal port that
isn't reachable from the host. A fresh server has no buckets — create
MINIO_TEST_BUCKET from the console before running the integration tests.
Releasing
Releases are published to PyPI automatically by .github/workflows/publish.yml
using Trusted Publishing (OIDC) —
no API tokens are stored in the repo.
One-time PyPI setup (per project): on PyPI go to the project's Settings → Publishing → Add a new pending/trusted publisher and register:
| Field | Value |
|---|---|
| Owner | aleksanm |
| Repository | masonite-minio |
| Workflow name | publish.yml |
| Environment | pypi |
To cut a release:
- Bump
versioninpyproject.tomland commit. - Tag it:
git tag -a vX.Y.Z -m "vX.Y.Z" && git push origin main vX.Y.Z. - Publish a GitHub Release for that tag (e.g.
gh release create vX.Y.Z --generate-notes).
Publishing the Release triggers the workflow, which builds the sdist + wheel,
verifies the built version matches the tag, and uploads to PyPI. (Adding the
GitHub pypi environment under Settings → Environments lets you gate the
publish step with required reviewers.)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file masonite_minio-0.1.3.tar.gz.
File metadata
- Download URL: masonite_minio-0.1.3.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fc82b173fa1038c672066ef18a39df3edb2d6ddc7f2be38fbbcc4d8c4ffc18c
|
|
| MD5 |
8a69811da50d63a8ca373069bbcb2843
|
|
| BLAKE2b-256 |
0ecf92ed23951e30662935c47e67bb56a8d93ce57a3d30051705e45295784add
|
Provenance
The following attestation bundles were made for masonite_minio-0.1.3.tar.gz:
Publisher:
publish.yml on aleksanm/masonite-minio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
masonite_minio-0.1.3.tar.gz -
Subject digest:
1fc82b173fa1038c672066ef18a39df3edb2d6ddc7f2be38fbbcc4d8c4ffc18c - Sigstore transparency entry: 1765133603
- Sigstore integration time:
-
Permalink:
aleksanm/masonite-minio@c36376d49f35e546a5bd2eff0a85542517f551e6 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/aleksanm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c36376d49f35e546a5bd2eff0a85542517f551e6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file masonite_minio-0.1.3-py3-none-any.whl.
File metadata
- Download URL: masonite_minio-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92e9be6098b2a08095723d12dcc1f7803fd15d37644a10f04d70a8557c607253
|
|
| MD5 |
fcfff00795c06d1dcb6f0db38236d9c6
|
|
| BLAKE2b-256 |
d017bafd68ed033cb7a9da4c206c6af5539480161eb22df1d9e70324a4f6a70b
|
Provenance
The following attestation bundles were made for masonite_minio-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on aleksanm/masonite-minio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
masonite_minio-0.1.3-py3-none-any.whl -
Subject digest:
92e9be6098b2a08095723d12dcc1f7803fd15d37644a10f04d70a8557c607253 - Sigstore transparency entry: 1765133800
- Sigstore integration time:
-
Permalink:
aleksanm/masonite-minio@c36376d49f35e546a5bd2eff0a85542517f551e6 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/aleksanm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c36376d49f35e546a5bd2eff0a85542517f551e6 -
Trigger Event:
release
-
Statement type: