MinIO Python Library for Amazon S3 Compatible Cloud Storage 
The MinIO Python Client SDK provides simple APIs to access any Amazon S3 compatible object storage server.
This quickstart guide will show you how to install the client SDK and execute an example python program. For a complete list of APIs and examples, please take a look at the Python Client API Reference documentation.
This document assumes that you have a working Python setup in place.
Minimum Requirements
- Python 2.7 or higher
Download from pip
pip install minio
Download from pip3
pip3 install minio
Download from source
git clone https://github.com/minio/minio-py
cd minio-py
python setup.py install
Initialize MinIO Client
You need four items in order to connect to MinIO object storage server.
| Params | Description |
|---|---|
| endpoint | URL to object storage service. |
| access_key | Access key is like user ID that uniquely identifies your account. |
| secret_key | Secret key is the password to your account. |
| secure | Set this value to 'True' to enable secure (HTTPS) access. |
from minio import Minio
from minio.error import ResponseError
minioClient = Minio('play.min.io',
access_key='Q3AM3UQ867SPQQA43P2F',
secret_key='zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG',
secure=True)
NOTE on concurrent usage: The Minio object is thread safe when using the Python threading library. Specifically, it is NOT safe to share it between multiple processes, for example when using multiprocessing.Pool. The solution is simply to create a new Minio object in each process, and not share it between processes.
Quick Start Example - File Uploader
This example program connects to a MinIO object storage server, makes a bucket on the server and then uploads a file to the bucket.
We will use the MinIO server running at https://play.min.io in this example. Feel free to use this service for testing and development. Access credentials shown in this example are open to the public.
file-uploader.py
# Import MinIO library.
from minio import Minio
from minio.error import (ResponseError, BucketAlreadyOwnedByYou,
BucketAlreadyExists)
# Initialize minioClient with an endpoint and access/secret keys.
minioClient = Minio('play.min.io',
access_key='Q3AM3UQ867SPQQA43P2F',
secret_key='zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG',
secure=True)
# Make a bucket with the make_bucket API call.
try:
minioClient.make_bucket("maylogs", location="us-east-1")
except BucketAlreadyOwnedByYou as err:
pass
except BucketAlreadyExists as err:
pass
except ResponseError as err:
raise
# Put an object 'pumaserver_debug.log' with contents from 'pumaserver_debug.log'.
try:
minioClient.fput_object('maylogs', 'pumaserver_debug.log', '/tmp/pumaserver_debug.log')
except ResponseError as err:
print(err)
Run file-uploader
python file_uploader.py
mc ls play/maylogs/
[2016-05-27 16:41:37 PDT] 12MiB pumaserver_debug.log
API Reference
The full API Reference is available here.
API Reference : Bucket Operations
make_bucketlist_bucketsbucket_existsremove_bucketlist_objectslist_objects_v2list_incomplete_uploads
API Reference : Bucket policy Operations
API Reference : Bucket notification Operations
set_bucket_notificationget_bucket_notificationremove_all_bucket_notificationlisten_bucket_notification
API Reference : Default bucket encryption configuration Operations
API Reference : File Object Operations
API Reference : Object Operations
get_objectput_objectstat_objectcopy_objectget_partial_objectremove_objectremove_objectsremove_incomplete_upload
API Reference : Presigned Operations
Full Examples
Full Examples : Bucket Operations
- make_bucket.py
- list_buckets.py
- bucket_exists.py
- list_objects.py
- remove_bucket.py
- list_incomplete_uploads.py
Full Examples : Bucket policy Operations
Full Examples: Bucket notification Operations
- set_bucket_notification.py
- get_bucket_notification.py
- remove_all_bucket_notification.py
- listen_bucket_notification.py
Full Examples: Default bucket encryption configuration Operations
Full Examples : File Object Operations
Full Examples : Object Operations
- get_object.py
- put_object.py
- stat_object.py
- copy_object.py
- get_partial_object.py
- remove_object.py
- remove_objects.py
- remove_incomplete_upload.py
Full Examples : Presigned Operations
Explore Further
Contribute
Metadata
Release files for minio 5.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| minio-5.0.9.tar.gz | 112.3 kB | Without provenance | Details for minio-5.0.9.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| minio-5.0.9-py3.6.egg | Legacy Egg format | - | - | Details for minio-5.0.9-py3.6.egg |
| minio-5.0.9-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for minio-5.0.9-py2.py3-none-any.whl |
Total release size: 327.7 kB
Release files / minio-5.0.9.tar.gz
| Download URL | minio-5.0.9.tar.gz |
|---|---|
| Size | 112.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba78e619088a87fd464a553086ff1eb1974e62ae3cbaa57a492eb3b62fb314b5
|
|
BLAKE2b-256 checksum How to use checksums |
e5b079234c9610980e5d6d67268734a298dbcd8aa02b3bbaeba5e03d7e22aec7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9
|
Release files / minio-5.0.9-py3.6.egg
| Download URL | minio-5.0.9-py3.6.egg |
|---|---|
| Size | 142.7 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
6de4a8d2c0616b757540782001e04f861823413a003007031348ea16afb49fe9
|
|
BLAKE2b-256 checksum How to use checksums |
5b1349dbcde5c47187e7dadb5d0cccccda82127ba854acfc144796eede7e51d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9
|
Release files / minio-5.0.9-py2.py3-none-any.whl
| Download URL | minio-5.0.9-py2.py3-none-any.whl |
|---|---|
| Size | 72.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
e9fff37cb2934f68a87abe343061cc789c5093b888fc4ed2328b991911b95ebc
|
|
BLAKE2b-256 checksum How to use checksums |
4f43393b5901fee97afc8e40f8083b9d88d49c0f4557c2037f9b853d59da2d18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9
|
Security for minio 5.0.9
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.