Skip to content

denis-ryzhkov/dynamo_db_dict

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

dynamo_db_dict

Simple Python interface to Amazon DynamoDB,
adding some dict-like sugar to boto.dynamodb.layer2.

Usage:

pip install dynamo_db_dict
from dynamo_db_dict import dynamo_db

db = dynamo_db(aws_access_key_id='YOUR KEY HERE', aws_secret_access_key='YOUR SECRET KEY HERE') # or via: os.environ, ~/.boto, /etc/boto.cfg
# Set table_name_prefix='YOUR_PROJECT_NAME_' if you use the same DynamoDB account for several projects.

# Either create table "user" with hash_key "email" via AWS concole, or via inherited db.create_table(...).
db.user['john@example.com'] = dict(first_name='John', last_name='Johnson') # Put. No need to repeat "email" in dict(...).
john = db.user['john@example.com'] # Get.
assert john == dict(email='john@example.com', first_name='John', last_name='Johnson') # Complete item, with "email".
assert john['first_name'] == 'John' # Key access.
assert john.first_name == 'John' # Attr access.
del db.user['john@example.com'] # Delete.

dynamo_db_dict version 0.2.4
Copyright (C) 2012 by Denis Ryzhkov denis@ryzhkov.org
MIT License, see http://opensource.org/licenses/MIT

About

Simple Python interface to Amazon DynamoDB, adding some dict-like sugar to boto.dynamodb.layer2.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages