{ "info": { "author": "Bochul Choi", "author_email": "vio.bo94@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "========\nBynamoDB\n========\n\nHigh-Level DynamoDB Interface for Python wrapping Low-Level Interface of boto\n\nInstallation\n============\n\nFrom PyPi::\n\n $ pip install bynamodb\n\nFrom GitHub::\n\n $ pip install git+https://github.com/teddychoi/BynamoDB#egg=bynamodb\n\nPatch DynamoDBConnection\n========================\n\nSet DynamoDBConnection default host and port.\n\n.. code-block:: python\n\n from bynamodb.patcher import patch_dynamodb_connection\n\n patch_dynamodb_connection(host='localhost', port=8000)\n\nModel Definition\n================\n.. code-block:: python\n\n import datetime\n from bynamodb.attributes import StringAttribute, StringSetAttribute\n from bynamodb.indexes import GlobalAllIndex\n from bynamodb.model import Model\n \n class Article(Model):\n published_at = StringAttribute(hash_key=True)\n id = StringAttribute(range_key=True)\n title = StringAttribute()\n content = StringAttribute()\n author = StringAttribute()\n write_time = StringAttribute(\n default=lambda: str(datetime.datetime.now()))\n tags = StringSetAttribute(default=set())\n thumbnail = StringAttribute(null=True)\n \n class AuthorIndex(GlobalAllIndex):\n read_throughput = 5\n write_throughput = 5\n hash_key = 'author'\n range_key = 'published_at'\n\nPut Item & Get Item\n===================\n.. code-block:: python\n\n Article.put_item(\n published_at='2014-12-09',\n id='1',\n title='This is the title',\n content='This is the content',\n author='Bochul Choi'\n )\n article = Article.get_item(hash_key='2014-12-09', range_key='1')\n\nGet Item from Raw Data\n======================\n\nYou can get items from raw data retrieved from `boto`'s low level API\n\n.. code-block:: python\n\n from boto.dynamodb2.layer1 import DynamoDBConnection\n\n conn = DynamoDBConnection()\n raw_data = conn.get_item(\n 'Article',\n {\n 'published_at': {'S': '2014-12-09'},\n 'id': {'S': '1'}\n }\n )\n article = Article.from_raw_data(raw_data['Item'])\n\nSimple Scan & Query\n===================\n.. code-block:: python\n\n # Scan all articles that the title starts with \"Title\"\n articles = Article.scan(title__startswith='Title')\n # Get the total count of matching items\n count = articles.count()\n # Get the iterator of matching items\n items = iter(articles)\n\n # Query articles that author is \"Bochul Choi\"\n articles = Article.query(author__eq='Bochul Choi', index_name='AuthorIndex')\n # The query result also provide the count method and iterator\n count = articles.count()\n items = iter(articles)\n\nComplex lookups in Scan & Query\n===============================\n.. code-block:: python\n\n from bynamodb.filterexps import Contains, GT\n \n keyword = 'bynamodb'\n filter_exp = GT('published_at', '2014-12-01') & (\n Contains('title', keyword) | Contains('content', keyword.upper()))\n \n # Scan all articles that match the filter expression\n articles = Article.scan(filter_exp)\n \n # Query articles that match the filter expression and the author condition\n author = 'Bochul Choi'\n articles = Atricle.query(author__eq=author, filter_builder=filter_exp,\n index_name='AuthorIndex')\n\n\nBatch Writing & Batch Reading\n=============================\n.. code-block:: python\n\n with Article.batch_write() as batch:\n batch.put_item({\n 'published_at': '2015-02-23',\n 'id': '1',\n 'title': 'Article 1',\n 'content': 'This is the content',\n 'author': 'Bochul Choi'\n })\n batch.put_item({\n 'published_at': '2015-02-23',\n 'id': '2',\n 'title': 'Article 2',\n 'content': 'This is the content',\n 'author': 'Bochul Choi'\n })\n\n articles = Article.batch_get(\n ('2015-02-23', '1'),\n ('2015-02-23', '2'),\n )\n\n\nChangelog\n=========\n0.1.7\n - Skip decoding non-existent attribute.\n0.1.6\n - Fix `ResultSet` to stop fetching items regardless of the limit param.\n0.1.5\n - Add support `scan_index_forward` and `limit` pamareter for Query API.\n0.1.4\n - Set `ExclusiveStartKey` as the untransformed `LastEvaluatedKey`.\n0.1.3\n - `Model.delete` needs to use encoded key.\n0.1.2\n - `Model.put_item` returns created item.\n0.1.1\n - `NumberAttribute` is only saved as number in db.\n", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/teddychoi/BynamoDB", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "bynamodb", "package_url": "https://pypi.org/project/bynamodb/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/bynamodb/", "project_urls": { "Homepage": "https://github.com/teddychoi/BynamoDB" }, "release_url": "https://pypi.org/project/bynamodb/0.1.7/", "requires_dist": null, "requires_python": null, "summary": "High-Level DynamoDB Interface for Pythonwrapping Low-Level Interface of boto", "version": "0.1.7" }, "last_serial": 1637385, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "95cbb368c44aa8532c4c7bcdd920ed72", "sha256": "119b9fd4aa977322c6c96a0e179cb294a73f2371fd7453cc94004d4053d36502" }, "downloads": -1, "filename": "bynamodb-0.1.0.tar.gz", "has_sig": false, "md5_digest": "95cbb368c44aa8532c4c7bcdd920ed72", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8196, "upload_time": "2015-02-23T04:48:16", "url": "https://files.pythonhosted.org/packages/72/48/88119f59e6fadeb2bf5d1921c7e16933edce16e63896a05bf74c6f41077e/bynamodb-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "68f68f57bf4e8e97486e9e8beb136ad8", "sha256": "bac4b394c1926463e5d9d1ea8515f10b7fc20fc8c0982106361c9797c0f3a5ed" }, "downloads": -1, "filename": "bynamodb-0.1.1.tar.gz", "has_sig": false, "md5_digest": "68f68f57bf4e8e97486e9e8beb136ad8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8160, "upload_time": "2015-02-25T08:24:06", "url": "https://files.pythonhosted.org/packages/7d/e8/2e81cea0aa4f2d782274421b7ab0a6dd342dfa51f7e2af221194759f1974/bynamodb-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "7ab5b92cb5ef80289778a16fea32fc02", "sha256": "d402b91ac3a8a9fd5dc5424ad0dfb5277c791ef752e87b47bd6c653bb05cfac5" }, "downloads": -1, "filename": "bynamodb-0.1.2.tar.gz", "has_sig": false, "md5_digest": "7ab5b92cb5ef80289778a16fea32fc02", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8253, "upload_time": "2015-02-26T06:56:13", "url": "https://files.pythonhosted.org/packages/a4/6f/0915b2de4f3732d8e24789ecd8a325185cd7935db55115e5f0c37a610a16/bynamodb-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "dcf685e211753ec48c49dabe8d2a6fcc", "sha256": "8651a64fd4f660c4eb6a57e64608016fcc1dd555f5f5524387565b3fe6aa9471" }, "downloads": -1, "filename": "bynamodb-0.1.3.tar.gz", "has_sig": false, "md5_digest": "dcf685e211753ec48c49dabe8d2a6fcc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8224, "upload_time": "2015-03-18T00:33:35", "url": "https://files.pythonhosted.org/packages/7d/71/9a46e6c29fd0f7597101af89365d1eba1c88e09515143ba5b78a14670808/bynamodb-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "d06c26f12f21043f425ab5d733f3f42e", "sha256": "869d279254438c272ae8a525957af445e893923f55bcff611484bf316538b7df" }, "downloads": -1, "filename": "bynamodb-0.1.4.tar.gz", "has_sig": false, "md5_digest": "d06c26f12f21043f425ab5d733f3f42e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8194, "upload_time": "2015-03-24T12:01:47", "url": "https://files.pythonhosted.org/packages/06/b4/29d6045c8a6f9a98760dce1601750ab928a00b86a329d128551eb5402884/bynamodb-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "aa4b4f0ae71fdb817865d64b3c23eb9f", "sha256": "17971fd9bb7629c21f6233d6be0b1625f09ed66f069d0033592f77704ddc28a5" }, "downloads": -1, "filename": "bynamodb-0.1.5.tar.gz", "has_sig": false, "md5_digest": "aa4b4f0ae71fdb817865d64b3c23eb9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8275, "upload_time": "2015-04-14T01:02:28", "url": "https://files.pythonhosted.org/packages/c6/ce/a64d18d18fab539d96f55b9585947888e18295ab675b3078be8071dcb8e5/bynamodb-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "2090d8912f075a018afebcb05740b8d6", "sha256": "90d93eeceeb9f04a3ae36814497e4c5f317f268167ef70876ac052f4495113a3" }, "downloads": -1, "filename": "bynamodb-0.1.6.tar.gz", "has_sig": false, "md5_digest": "2090d8912f075a018afebcb05740b8d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8420, "upload_time": "2015-04-14T10:22:50", "url": "https://files.pythonhosted.org/packages/b1/ea/569a760e0c2bacf837b4d639f204c94c6ab3b3236407275a4f39afeeecc7/bynamodb-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "8e562247afe8cb12ee1d9dd41ec2da37", "sha256": "da5d5b355f568ec1d47206237e3ca17b3045282dadf97751386558383fa432af" }, "downloads": -1, "filename": "bynamodb-0.1.7.tar.gz", "has_sig": false, "md5_digest": "8e562247afe8cb12ee1d9dd41ec2da37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8460, "upload_time": "2015-07-17T05:59:34", "url": "https://files.pythonhosted.org/packages/d7/1f/461f4c9b6e67980820a136fef018cc7af950bb75b12763aa3e8ee2849e09/bynamodb-0.1.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8e562247afe8cb12ee1d9dd41ec2da37", "sha256": "da5d5b355f568ec1d47206237e3ca17b3045282dadf97751386558383fa432af" }, "downloads": -1, "filename": "bynamodb-0.1.7.tar.gz", "has_sig": false, "md5_digest": "8e562247afe8cb12ee1d9dd41ec2da37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8460, "upload_time": "2015-07-17T05:59:34", "url": "https://files.pythonhosted.org/packages/d7/1f/461f4c9b6e67980820a136fef018cc7af950bb75b12763aa3e8ee2849e09/bynamodb-0.1.7.tar.gz" } ] }