diff --git a/docs/sdks/python/example-list-buckets.py b/docs/sdks/python/example-list-buckets.py new file mode 100644 index 00000000..0d1cf793 --- /dev/null +++ b/docs/sdks/python/example-list-buckets.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python + +import boto3 +s3 = boto3.resource('s3', use_ssl=False, endpoint_url="http://localhost:9000") +for bucket in s3.buckets.all(): + print(bucket.name) diff --git a/docs/sdks/python/python.md b/docs/sdks/python/python.md new file mode 100644 index 00000000..88d2dc3e --- /dev/null +++ b/docs/sdks/python/python.md @@ -0,0 +1,32 @@ +# AWS SDK for Python + +## Install + +### In Python 2.6, 2.7, 3.3, 3.4 + +**WARNING**: Boto 3 is in *developer preview* and **should not** be used in production yet! + +``` +pip install boto3 +``` + +### Example + +Next, set up credentials (in e.g. ``~/.aws/credentials``):: + + [default] + aws_access_key_id = YOUR_MINIO_ACCESS_ID + aws_secret_access_key = YOUR_MINIO_SECRET_KEY + +``` +#!/usr/bin/env python + +import boto3 +s3 = boto3.resource('s3', use_ssl=False, endpoint_url="http://localhost:9000") +for bucket in s3.buckets.all(): + print(bucket.name) +... +bucket1 +bucket2 +bucket3 +``` diff --git a/mkdocs.yml b/mkdocs.yml index 90364027..1c2a1e1b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -2,5 +2,6 @@ site_name: Minio Client Documentation pages: - ['index.md', Index] - ['sdks/js/javascript.md', 'SDKs', 'Javascript'] +- ['sdks/python/python.md', 'SDKs', 'Python'] - ['contributing.md', 'Contributing', 'Overview'] theme: readthedocs