Skip to main content

Minio helper utility for digital-club project

Project description

MinIO Helper for Digital Club

MinIO Helper is a specialized Python package developed for the Digital Club. This package facilitates the secure and time-limited access to files stored in a MinIO bucket by generating signed URLs. Features

Project-specific: Designed specifically for the Digital Club project, making integration seamless.
Secure Access: Easily generate signed URLs to securely access objects stored in a MinIO bucket.
Customizable Expiration: Set expiration time as needed for each URL.

Installation

To install MinIO Helper, first clone this repository and build the package:

bash

python setup.py sdist bdist_wheelv

Then, install the package locally:

bash

pip install dist/minio_helper-0.1-py3-none-any.whl

Or, if you prefer, use twine to upload to PyPI and install directly:

bash

twine upload dist/* pip install minio_helper

Usage

  1. Add MinIO Helper Configuration to settings.py

To configure MinIO Helper in your Django project, add the following settings to settings.py:

python

settings.py

MINIO_STORAGE_ENDPOINT = 'your-minio-endpoint' MINIO_STORAGE_ACCESS_KEY = 'your-access-key' MINIO_STORAGE_SECRET_KEY = 'your-secret-key' MINIO_STORAGE_USE_HTTPS = True # Set to False if using HTTP

  1. Using get_signed_url in Your Project

After setting up, you can use get_signed_url to create secure, temporary URLs for accessing files:

python

from minio_utils.minio_helper import get_signed_url

Generate a signed URL with 24-hour expiration

signed_url = get_signed_url('/clubs-media/myfile.jpg', expiry_hours=24) print(signed_url)

Example Usage in a Django View

python

from django.http import JsonResponse from minio_utils.minio_helper import get_signed_url

def get_file_url(request, file_path): signed_url = get_signed_url(file_path, expiry_hours=24) return JsonResponse({'signed_url': signed_url})

Requirements

Django
MinIO Python SDK

License

This project is licensed under the MIT License. See the LICENSE file for details. About Digital Club Project

This package was created for the Digital Club to ensure secure access to media assets stored in MinIO. The project aims to streamline file sharing and secure access for club members, partners, and stakeholders. Contact

For questions or additional support, please contact the Digital Club.

Project details


Download files

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

Source Distribution

minio_helper-0.0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

minio_helper-0.0.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file minio_helper-0.0.1.tar.gz.

File metadata

  • Download URL: minio_helper-0.0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for minio_helper-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2ee19b876baa30500ea89576cbd10abb8014b81ceca85b38fb5a72251ef494a0
MD5 69589d1c2a4c191d8ab5fa57072fc4ac
BLAKE2b-256 33bf9e806483a2b802ed9e157e20d3eeafd609ecbc47a92fd8a0a97fa499c041

See more details on using hashes here.

File details

Details for the file minio_helper-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: minio_helper-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for minio_helper-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 34aa00998fb9bc9a55bbc229b22b457e78cf31a65aa3adac83f4d3703af22a68
MD5 1c2d49d7d6e552b1e8e5b78911b1e0fa
BLAKE2b-256 8bf0cfc548b29a32c2a877699d0ccc4d01edf7e12bc46fea88694a1103dbb1d8

See more details on using hashes here.

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