Friday 9 September 2011

Easily access Cloud computing and files with python libcloud

I heard about libcloud on the podcast FLOSS 181, it makes it easy to access cloud things from Python. This example code lists all the file objects in all containers, to use this you will need to modify the API_ constants to your account.


API_USERNAME = "xxxxxxxx"
API_PASSWORD = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

storage =

for container in storage.list_containers():
    print "Container: %s" %
    for fileobj in container.list_objects():
        print "> Object: \"%s\", Size: %d bytes" % (
  , fileobj.size) 

No comments:

Post a Comment