Skip to content

dgelvin/minio-py

 
 

Repository files navigation

Minio Python Library for Amazon S3 Compatible Cloud Storage Gitter

Install Build Status

The recommended technique for installing this package is through pip.

$ pip install minio

Example

#!/usr/bin/env python

from minio import Minio

# Instantiate a client
client = Minio('s3.amazonaws.com',
                access_key='access_key',
                secret_key='secret_key')

# List buckets
buckets = client.list_buckets()
for bucket in buckets:
    print('bucket:', bucket.name, bucket.creation_date)

Setting up development environment

You can follow below mentioned steps for downloading minio-py from source.

$ sudo apt-get install git python-pip
$ sudo  pip install virtualenv
$ cd my_project_folder
$ virtualenv --no-site-packages venv
$ source venv/bin/activate
$ git clone https://github.com/minio/minio-py
$ cd minio-py
$ python setup.py install

Examples:

Bucket Operations.

make_bucket(bucket, location, acl)

list_buckets()

bucket_exists(bucket)

remove_bucket(bucket)

get_bucket_acl(bucket)

set_bucket_acl(bucket_name, acl=Acl.private())

list_incomplete_uploads(bucket_name, prefix=None, recursive=False)

Object Operations.

get_object(bucket_name, object_name)

get_partial_object(bucket_name, object_name, offset, length)

put_object(bucket_name, object_name, length, data, content_type='application/octet_stream')

list_objects(bucket_name, prefix=None, recursive=False)

stat_object(bucket_name, object_name)

remove_object(bucket_name, object_name)

remove_incomplete_upload(bucket_name, object_name)

Presigned Operations.

presigned_get_object(bucket_name, object_name, expires=604800)

presigned_put_object(bucket_name, object_name, expires=604800)

presigned_post_policy(policy=PostPolicy())

Contribute

Contributors Guide

PYPI PYPI PYPI PYPI

About

Minio Python Library for Amazon S3 compatible cloud storage

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.9%
  • Makefile 0.1%