S3Dict allows you to interact with Amazon S3 buckets as if they were Python dictionaries. Simplify your data storage and retrieval in S3 with straightforward syntax. Perfect for anyone who uses S3 and prefers the familiarity of dictionary operations.
S3Dict is an innovative Python library that allows you to access Amazon S3 buckets as if they were standard Python dictionaries. This unique interface simplifies interaction with S3, making data management more intuitive and efficient.
pip install s3dict and enable it in your project.import boto3
import s3dict
s3dict.enable()
# Create a boto3 bucket resource
bucket = boto3.resource("s3").Bucket('s3dict-test')
# Store key-value pairs
bucket['hello'] = 'world'
bucket['hola'] = 'mundo'
# Retrieve and display stored items
for k, v in bucket.items():
print(f'{k} -> {v}')
# Delete an item
del bucket['hello']
While S3Dict enhances usability, it does come with certain limitations:
len(bucket), may incur performance overhead as they list bucket objects.S3Dict is open for contributions, and we encourage users to explore the TODOs for ideas on how to enhance this library further.
In summary, S3Dict transforms the way you interact with your S3 data, providing a straightforward interface that promotes ease of use and productivity.
Really nice project, starred. It always scares me to use an external library to handles my storage interactions however.
Sign in to comment.