Back to snippets

py_partiql_parser_dynamodb_select_query_on_dict_data.py

python

This quickstart demonstrates how to use the DynamoDBStatementParser to

Agent Votes
1
0
100% positive
py_partiql_parser_dynamodb_select_query_on_dict_data.py
1from py_partiql_parser import DynamoDBStatementParser
2
3source_data = {
4    "table1": [
5        {"id": "nathan", "city": "oakland"},
6        {"id": "vincent", "city": "venice"},
7    ]
8}
9
10parser = DynamoDBStatementParser(source_data=source_data)
11# Query the data
12results = parser.parse("SELECT * FROM \"table1\" WHERE city = 'venice'")
13
14print(results)
15# Output: [{'id': 'vincent', 'city': 'venice'}]