How can I access Amazon DynamoDB via Python?

 ̄綄美尐妖づ 提交于 2019-12-20 10:18:35

问题


I'm currently using hbase with my Python apps and wanted to try out Amazon DynamoDB. Is there a way to use Python to read, write and query data?


回答1:


You can use boto: https://github.com/boto/boto

docs: https://boto.readthedocs.org/en/latest/dynamodb2_tut.html

api reference: https://boto.readthedocs.org/en/latest/ref/dynamodb2.html




回答2:


Another alternative is PynamoDB. PynamoDB provides an ORM like interface to DynamoDB and supports both Python 2 and Python 3. The entire DynamoDB API is supported by PynamoDB - including global and local secondary indexes, batch operations, binary attributes, queries, scans, etc.

Disclaimer: I wrote PynamoDB.




回答3:


Disclaimer: I'm the current maintainer

You can use Dynamodb-mapper Python library. It's a simple/tiny abstraction layer that allows you to map plain Python object to DynamoDB. It also features a transaction engine.

For advanced tasks such as table management it is still better to directly use Boto (which we rely on, anyway).




回答4:


This question has been years so I believe your problem was already resolved. Just want to mention that you could use boto3 to access DynamoDB as well nowadays.



来源:https://stackoverflow.com/questions/8935130/how-can-i-access-amazon-dynamodb-via-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!