GithubHelp home page GithubHelp logo

bhanditz / minio-py Goto Github PK

View Code? Open in Web Editor NEW

This project forked from minio/minio-py

0.0 1.0 0.0 1.24 MB

Minio Client SDK for Python

Home Page: https://minio.io/downloads.html#download-sdk-python

License: Apache License 2.0

Makefile 0.04% Python 99.32% Shell 0.64%

minio-py's Introduction

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.minio.io:9000',
                  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.minio.io:9000 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.minio.io:9000',
                    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 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

minio-py's People

Contributors

balamurugana avatar chillaranand avatar colhodm avatar dcavalcante avatar deekoder avatar deke42 avatar dgelvin avatar dhilipsiva avatar donatello avatar drjackild avatar ebozduman avatar erickgnavar avatar fkautz avatar frnknglrt avatar g-cassie avatar garimakapoor avatar harshavardhana avatar indradhanush avatar kadenlnelson avatar kannappanr avatar koolhead17 avatar krishnasrinivas avatar krisis avatar minio-trusted avatar poornas avatar praveenrajmani avatar prior99 avatar smouli avatar vadmeste avatar waydotnet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.