Skip to content

A local file cache for Amazon S3 using Python and boto

Notifications You must be signed in to change notification settings

vincetse/python-s3-cache

Repository files navigation

Build Status Code Coverage Issue Count

S3 Cache for Python

Niall McCarroll wrote a neat little AWS S3 cache on his blog that I found really useful, but could not find on PyPI, so here it is in a refactored form as a public service.

Instructions

from s3cache import S3Cache

s3 = S3Cache("/tmp", "t13d-misc")
s3.connect()
s3.create_bucket()
assert(s3.bucket_exists())

s3.set_verbosity(True)
s3.set_caching(True)

f = s3.open("/tmp/world.txt", "w")
f.write("Hello")
f.close()

f = s3.open("/tmp/world.txt", "a")
f.write(" World")
f.close()

f2 = s3.open("/tmp/world.txt", "r")
f2.close()

assert(s3.object_exists("/tmp/world.txt"))
s3.remove_object("/tmp/world.txt")

References

  1. A local file cache for amazon S3 using python and boto

About

A local file cache for Amazon S3 using Python and boto

Resources

Stars

Watchers

Forks

Packages

No packages published