{"id":26045849,"url":"https://github.com/gridsmartercities/aws-dynamodb-parser","last_synced_at":"2025-04-10T11:50:52.296Z","repository":{"id":46134382,"uuid":"180809675","full_name":"gridsmartercities/aws-dynamodb-parser","owner":"gridsmartercities","description":"AWS DynamoDB utility for parsing DynamoDB responses","archived":false,"fork":false,"pushed_at":"2021-11-12T11:08:36.000Z","size":44,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-24T10:38:52.863Z","etag":null,"topics":["aws","aws-lambda","dynamodb","python","python-package","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gridsmartercities.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-11T14:28:26.000Z","updated_at":"2023-06-16T06:09:16.000Z","dependencies_parsed_at":"2022-09-11T15:31:03.438Z","dependency_job_id":null,"html_url":"https://github.com/gridsmartercities/aws-dynamodb-parser","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridsmartercities%2Faws-dynamodb-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridsmartercities%2Faws-dynamodb-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridsmartercities%2Faws-dynamodb-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridsmartercities%2Faws-dynamodb-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gridsmartercities","download_url":"https://codeload.github.com/gridsmartercities/aws-dynamodb-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248215192,"owners_count":21066619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","dynamodb","python","python-package","python3"],"created_at":"2025-03-07T20:49:46.020Z","updated_at":"2025-04-10T11:50:52.276Z","avatar_url":"https://github.com/gridsmartercities.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[\u003cimg align=\"right\" alt=\"Grid Smarter Cities\" src=\"https://s3.eu-west-2.amazonaws.com/open-source-resources/grid_smarter_cities_small.png\"\u003e](https://www.gridsmartercities.com/)\n\n![Build Status](https://codebuild.eu-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiZGdTRFhHdng1Mks0THRaT2VkR3JYaWpOWGlwNjYvVGVYWUNoZGp6VW9MZDRMZ1I0WDFVNFJ0cHBORkJJVSswMWQ1VkxISGNFR1dWTElrWThDTVBldjUwPSIsIml2UGFyYW1ldGVyU3BlYyI6IlFMS1V1K0F5a1BHRTZlN0IiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D\u0026branch=master)\n[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)\n[![PyPI](https://img.shields.io/pypi/v/aws-dynamodb-parser.svg?color=brightgreen)](https://pypi.org/project/aws-dynamodb-parser/)\n\n# AWS DynamoDB Parser\n\nAWS DynamoDB utility for parsing DynamoDB responses\n\n## Installation\n```\npip install aws-dynamodb-parser\n```\n\n## Package Contents\n### [parse](https://github.com/gridsmartercities/aws-dynamodb-parser/blob/master/aws_dynamodb_parser/utils.py#L4)\n`parse` is the main method exposed for parsing DynamoDB responses when using `boto3`.\n\nThe `parse` function can handle [all of the data types AWS DynamoDB supports](https://boto3.amazonaws.com/v1/documentation/api/latest/_modules/boto3/dynamodb/types.html) as of October 2020.\n\n## Examples\nAssuming we have a table `TABLE_NAME` containing the following entries, with `id` set as the partition key and `timestamp` as the sort key.\n\nAll three fields included are strings.\n\n|id                                  |timestamp                 |name             |\n|------------------------------------|--------------------------|-----------------|\n|a77b5fc0-75cb-408c-bebf-863873506cce|2020-10-01 13:13:47.388492|First test entry |\n|a77b5fc0-75cb-408c-bebf-863873506cce|2020-10-01 13:15:25.376589|Second test entry|\n|fa853ff0-706e-45db-b6ae-aa6a8a1f7856|2020-10-01 13:16:47.720778|Third test entry |\n\n\nParsing the result from a `get_item` request:\n\n```py\nimport boto3\nfrom aws_dynamodb_parser import parse\n\ndynamodb_client = boto3.client(\"dynamodb\")\nresponse = dynamodb_client.get_item(\n    TableName=\"TABLE_NAME\",\n    Key={\n        \"id\": {\"S\": \"a77b5fc0-75cb-408c-bebf-863873506cce\"},\n        \"timestamp\": {\"S\": \"2020-10-01 13:13:47.388492\"}\n    }\n)\n\nitem = response.get(\"Item\", {})\nprint(item)\n# {'id': {'S': 'a77b5fc0-75cb-408c-bebf-863873506cce'}, 'timestamp': {'S': '2020-10-01 13:13:47.388492'}, 'name': {'S': 'First test entry'}}\n\nentry = parse(item)\nprint(entry)\n# {'id': 'a77b5fc0-75cb-408c-bebf-863873506cce', 'timestamp': '2020-10-01 13:13:47.388492', 'name': 'First test entry'}\n```\n\nParsing the result from a `query` request:\n\n```py\nimport boto3\nfrom aws_dynamodb_parser import parse\n\ndynamodb_client = boto3.client(\"dynamodb\")\nresponse = dynamodb_client.query(\n    TableName=\"TABLE_NAME\",\n    KeyConditionExpression=\"#id = :id\",\n    ExpressionAttributeNames={\n        \"#id\": \"id\"\n    },\n    ExpressionAttributeValues={\n        \":id\": {\"S\": \"a77b5fc0-75cb-408c-bebf-863873506cce\"}\n    }\n)\n\nitems = response.get(\"Items\", [])\nprint(items)\n# [{'id': {'S': 'a77b5fc0-75cb-408c-bebf-863873506cce'}, 'timestamp': {'S': '2020-10-01 13:13:47.388492'}, 'name': {'S': 'First test entry'}}, {'id': {'S': 'a77b5fc0-75cb-408c-bebf-863873506cce'}, 'timestamp': {'S': '2020-10-01 13:15:25.376589'}, 'name': {'S': 'Second test entry'}}]\n\nentries = parse(items)\nprint(entries)\n# [{'id': 'a77b5fc0-75cb-408c-bebf-863873506cce', 'timestamp': '2020-10-01 13:13:47.388492, 'name': 'First test entry'}, {'id': 'a77b5fc0-75cb-408c-bebf-863873506cce', 'timestamp': '2020-10-01 13:15:25.376589', 'name': 'Second test entry'}]\n```\n\n## Documentation\nUsers can get the docstring help by running:\n```py\nfrom aws_dynamodb_parser import parse\nhelp(parse)\n```\n\n## Links\n- [Github](https://github.com/gridsmartercities/aws-dynamodb-parser)\n- [PyPI](https://pypi.org/project/aws-dynamodb-parser/)\n- [Test PyPI](https://test.pypi.org/project/aws-dynamodb-parser/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgridsmartercities%2Faws-dynamodb-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgridsmartercities%2Faws-dynamodb-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgridsmartercities%2Faws-dynamodb-parser/lists"}