Skip to main content

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.py for reference. The driver reads options from DISKS, 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:

  1. Bump version in pyproject.toml and commit.
  2. Tag it: git tag -a vX.Y.Z -m "vX.Y.Z" && git push origin main vX.Y.Z.
  3. 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

Metadata

Release files for masonite-minio 0.1.3

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

Source distribution (sdist)

Source distribution for masonite-minio 0.1.3
File Size Uploaded Provenance Actions
masonite_minio-0.1.3.tar.gz 7.7 kB With provenance Details for masonite_minio-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for masonite-minio 0.1.3
File Interpreter ABI Platform Actions
masonite_minio-0.1.3-py3-none-any.whl Python 3 none any Details for masonite_minio-0.1.3-py3-none-any.whl

Total release size: 14.7 kB

Release files / masonite_minio-0.1.3.tar.gz

Download URL masonite_minio-0.1.3.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1fc82b173fa1038c672066ef18a39df3edb2d6ddc7f2be38fbbcc4d8c4ffc18c
BLAKE2b-256 checksum
How to use checksums
0ecf92ed23951e30662935c47e67bb56a8d93ce57a3d30051705e45295784add
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.

Transparency log

Release files / masonite_minio-0.1.3-py3-none-any.whl

Download URL masonite_minio-0.1.3-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92e9be6098b2a08095723d12dcc1f7803fd15d37644a10f04d70a8557c607253
BLAKE2b-256 checksum
How to use checksums
d017bafd68ed033cb7a9da4c206c6af5539480161eb22df1d9e70324a4f6a70b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.

Transparency log

Security for masonite-minio 0.1.3

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for masonite_minio-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.

Transparency log

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.

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