Skip to main content

MinIO Python Library for Amazon S3 Compatible Cloud Storage for Python

Project description

MinIO Python Library for Amazon S3 Compatible Cloud Storage Slack

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)

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
else:
        # 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

API Reference : Bucket policy Operations

API Reference : Bucket notification Operations

API Reference : File Object Operations

API Reference : Object Operations

API Reference : Presigned Operations

Full Examples

Full Examples : Bucket Operations

Full Examples : Bucket policy Operations

Full Examples: Bucket notification Operations

Full Examples : File Object Operations

Full Examples : Object Operations

Full Examples : Presigned Operations

Explore Further

Contribute

Contributors Guide

PYPI Build Status Build status

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

minio-4.0.21.tar.gz (101.8 kB view details)

Uploaded Source

Built Distributions

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

minio-4.0.21-py3.5.egg (121.7 kB view details)

Uploaded Egg

minio-4.0.21-py2.py3-none-any.whl (60.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file minio-4.0.21.tar.gz.

File metadata

  • Download URL: minio-4.0.21.tar.gz
  • Upload date:
  • Size: 101.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.5.2

File hashes

Hashes for minio-4.0.21.tar.gz
Algorithm Hash digest
SHA256 35643f056b4d12e053fa7d8f40d98394ed7cc4d5d44ba53c9971e7428fd58e60
MD5 41fb46b9eb61053a555f1ba7a061555c
BLAKE2b-256 220c422502787adef1df1da5943733434bb2ed5349c8267efc5c8bb3cd91b3b2

See more details on using hashes here.

File details

Details for the file minio-4.0.21-py3.5.egg.

File metadata

  • Download URL: minio-4.0.21-py3.5.egg
  • Upload date:
  • Size: 121.7 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.5.2

File hashes

Hashes for minio-4.0.21-py3.5.egg
Algorithm Hash digest
SHA256 c54f1f27fc821bcc949762b86a44c99bb2c873b54062a5db64b2b1665e5f3b7e
MD5 5eed5d7bc0ef4dcdfad39f01a3a2f118
BLAKE2b-256 e8956f05efaa1623b1fa4db9b3e39d89d50c2c06bcd70cf023563538938842c0

See more details on using hashes here.

File details

Details for the file minio-4.0.21-py2.py3-none-any.whl.

File metadata

  • Download URL: minio-4.0.21-py2.py3-none-any.whl
  • Upload date:
  • Size: 60.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.5.2

File hashes

Hashes for minio-4.0.21-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 766c1f2eb1a6f0d1d5fd9dd3660a1246dee9f03e58c0f83903e448d116734499
MD5 1645e23577ac7fb4bcc7d268d77afc35
BLAKE2b-256 1a5919a86d404e15f6e09f5b1f8abc9c6c2cdf5f40606ce8effa220eaf5887b0

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