Dynamodb-mapper – a DynamoDB object mapper, based on boto.
Presentation
DynamoDB is a minimalistic NoSQL engine provided by Amazon as a part of their AWS product.
DynamoDB allows you to stores documents composed of unicode strings or numbers as well as sets of unicode strings and numbers. Each tables must define a hash key and may define a range key. All other fields are optional.
Dynamodb-mapper brings a tiny abstraction layer over DynamoDB to overcome some of the limitations with no performance compromise. It is highly inspired by the mature MoongoKit project
Full documentation: http://dynamodb-mapper.readthedocs.org/en/latest/
Report bugs: https://bitbucket.org/Ludia/dynamodb-mapper/issues
Requirements
Boto = 2.6.0
AWS account
Highlights
Python <–> DynamoDB type mapping
Deep schema definition and validation with Onctuous (new in 1.8.0)
Multi-target transaction (new in 1.6.0)
Sub-transactions (new in 1.6.2)
Migration engine (new in 1.7.0)
Smart conflict detection (new in 1.7.0)
Full low-level chunking abstraction for scan, query and get_batch
Default values
Auto-inc hash_key
Framework agnostic
Example usage
We assume you’ve correctly set your Boto credentials or use ddbmock.
Quick install
$ pip install dynamodb-mapper
If you have not yet configured Boto, you may simply
$ export AWS_ACCESS_KEY_ID=<your id key here> $ export AWS_SECRET_ACCESS_KEY=<your secret key here>
First Model
from dynamodb_mapper.model import DynamoDBModel
class DoomMap(DynamoDBModel):
__table__ = u"doom_map"
__hash_key__ = u"episode"
__range_key__ = u"map"
__schema__ = {
u"episode": int,
u"map": int,
u"name": unicode,
u"cheats": set,
}
__defaults__ = {
"cheats": set([u"Konami"]),
}
Initial Table creation
from dynamodb_mapper.model import ConnectionBorg conn = ConnectionBorg() conn.create_table(DoomMap, 10, 10, wait_for_active=True)
Model Usage
e1m1 = DoomMap()
e1m1.episode = 1
e1m1.map = 1
e1m1.name = u"Hangar"
e1m1.cheats = set([u"idkfa", u"iddqd", u"idclip"])
e1m1.save()
# Later on, retrieve that same object from the DB...
e1m1 = DoomMap.get(1, 1)
# query all maps of episode 1
e1_maps = DoomMap.query(hash_key=1)
# query all maps of episode 1 with 'map' hash_key > 5
from boto.dynamodb.condition import GT
e1_maps_after_5 = DoomMap.query(
hash_key=1,
range_key_condition=GT(5))
Contribute
Want to contribute, report a but of request a feature ? The development goes on at Ludia’s BitBucket account:
Dynamodb-mapper
Report bugs: https://bitbucket.org/Ludia/dynamodb-mapper/issues
Fork the code: https://bitbucket.org/Ludia/dynamodb-mapper/overview
Onctuous
Full documentation: https://onctuous.readthedocs.org/en/latest
Report bugs: https://bitbucket.org/Ludia/onctuous/issues
Download: http://pypi.python.org/pypi/onctuous
Metadata
Release files for dynamodb-mapper 1.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dynamodb-mapper-1.8.1.tar.gz | 26.1 kB | Without provenance | Details for dynamodb-mapper-1.8.1.tar.gz |
Release files / dynamodb-mapper-1.8.1.tar.gz
| Download URL | dynamodb-mapper-1.8.1.tar.gz |
|---|---|
| Size | 26.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f93a15a68bde9aefda33914cb3ed62b9f819df7ba20e4153633667829cb6982
|
|
BLAKE2b-256 checksum How to use checksums |
7c7463425222b18532ad3b68b553fb0dddd16d6c0ca429b800a249dfce3a81af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for dynamodb-mapper 1.8.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.