Dynamo AWS python script list all tables , structure and items

Hi All

just tried to look in Amazon Dynamo and python , as beginner and no programmer , maybe there are others out and I share my work .

All the best

Allways a Beginner


import boto.dynamodb
import boto.dynamodb.condition

#AWS setting
access_key_id = “Your AWS Key”
secret_key = “Your AWS secret key”

#connect to AWS
conn = boto.connect_dynamodb( access_key_id, secret_key)

#list all tables at amazon and show structure
awstables = conn.list_tables()
for item in awstables:
      print “Table: “
      print item
      awstables_desc= conn.describe_table(item)
      print “Tabledescription :”
      print awstables_desc
      # list database items
      awstable = conn.get_table(item)
      if awstable.item_count > 0:
              db_line = awstable.scan()
              for i in db_line:
                      print “Item : “
                      print i


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: