A simple library for interacting with Amazon S3.
Project description
BucketStore is a very simple Amazon S3 client, written in Python. It aims to be much more straight-forward to use than boto3, and specializes only in Amazon S3, ignoring the rest of the AWS ecosystem.
Features
Treats S3 Buckets as Key/Value stores.
Automatic support for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.
Easily make keys (or entire buckets) publically accessable.
Easily get the public URL for a given key.
Generates temporary URLs for a given key.
Usage
Get (or create) a bucket, easily:
import bucketstore # Create the bucket if it doesn't exist. bucket = bucketstore.get('bucketstore-playground', create=True)
Treat the bucket like a key/value store:
>>> bucket['foo'] = 'bar' >>> bucket['foo'] bar >>> bucket.set('foo2', 'bar2') >>> bucket.get('foo2') bar2 >>> bucket.list() [u'foo', u'foo2'] >>> bucket.all() [<S3Key bucket='bucketstore-playground' name=u'foo'>, <S3Key bucket='bucketstore-playground' name=u'foo2'>]
Interact with S3 keys:
>>> bucket.key('foo') <S3Key bucket='bucketstore-playground' name=u'foo'> >>> foo.set('new value') # Generate a temporary share URL. >>> foo.temp_url(duration=1200) u'https://bucketstore-playground.s3.amazonaws.com/foo?AWSAccessKeyId=AKIAI2RVFNXIW7WS66QQ&Expires=1485493909&Signature=L3gD9avwQZQO1i11dIJXUiZ7Nx8%3D' # Make key publically accessable. >>> foo.make_public() >>> foo.url 'https://s3.amazonaws.com/bucketstore-playground/foo' # Get / set metadata for key. >>> foo.meta {} # Rename key to 'foo3'. >>> foo.rename('foo3') # Delete the key. >>> foo.delete()
Other methods include bucketstore.login(access_key_id, secret_access_key), bucketstore.list(), and bucketstore.get(bucket_name, create=False).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bucketstore-0.1.1.tar.gz
.
File metadata
- Download URL: bucketstore-0.1.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d5f06f8a18af9928b1be141b43f8158aa7679782bea0cce9f5059f56ac0d765 |
|
MD5 | 6707a18c50f217b19d99ee95b8d380f6 |
|
BLAKE2b-256 | 3cefabc8f1a2deb38c5ed643aad0471b5b581bfe545bf4832c7d34b9c259062d |
File details
Details for the file bucketstore-0.1.1-py2-none-any.whl
.
File metadata
- Download URL: bucketstore-0.1.1-py2-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9088fe789a782d8a506b794f4df91312a124c61980abc14b9bd0d231c95515e |
|
MD5 | a9597a3577aca07f73df4cc3c4260427 |
|
BLAKE2b-256 | f585b1923fa4cda204fdbb6bd9b6c8e6d73876383b837f2c65c11a33e4d7fce9 |