{"library":"py-partiql-parser","title":"Py PartiQL Parser","description":"py-partiql-parser is a pure Python tokenizer, parser, and executor for the PartiQL language. PartiQL is an expressive, SQL-compatible query language for relational, semi-structured, and nested data, primarily maintained by Amazon. The library is currently at version 0.6.3 and appears to be actively maintained, with releases indicating ongoing development, though without a fixed cadence.","status":"active","version":"0.6.3","language":"en","source_language":"en","source_url":"https://github.com/getmoto/py-partiql-parser","tags":["PartiQL","parser","SQL","query language","DynamoDB","AWS","AST"],"install":[{"cmd":"pip install py-partiql-parser","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"DynamoDBStatementParser","correct":"from py_partiql_parser import DynamoDBStatementParser"}],"quickstart":{"code":"from py_partiql_parser import DynamoDBStatementParser\n\n# Instantiate the parser\nparser = DynamoDBStatementParser()\n\n# PartiQL statement to parse\nstatement = \"select * from my_table where id = '123'\"\n\n# Parse the statement to get the Abstract Syntax Tree (AST)\nparsed_ast = parser.parse(statement)\nprint(f\"Parsed AST: {parsed_ast}\")\n\n# You can also execute the parsed statement with an in-memory dataset\ndata = [{\"id\": \"123\", \"name\": \"foo\"}, {\"id\": \"456\", \"name\": \"bar\"}]\nresult = parsed_ast.execute(data)\nprint(f\"Execution result: {result}\")","lang":"python","description":"This example demonstrates how to parse a PartiQL statement into an Abstract Syntax Tree (AST) and then execute it against an in-memory Python list of dictionaries using the built-in executor."},"warnings":[{"fix":"Refer to the project's GitHub repository for the latest documentation and changelog. Test thoroughly when upgrading.","message":"The project is described as 'Much beta, such wow' on PyPI. This suggests the library is still under active development and may have evolving APIs or unaddressed edge cases. Users should be mindful of potential changes in future minor versions.","severity":"gotcha","affected_versions":"0.1.0-0.6.x"},{"fix":"Consult both the `py-partiql-parser` documentation and AWS's official PartiQL documentation for DynamoDB to understand potential dialect differences if targeting AWS services.","message":"The library explicitly notes that AWS's native PartiQL implementation (e.g., in DynamoDB) does not fully follow the PartiQL spec, specifically regarding querying lists of JSON documents (e.g., `SELECT *` vs. `SELECT key` for each document) and lacking `SELECT VALUES`. The parser's behavior might therefore differ from AWS's actual runtime.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For live AWS DynamoDB queries, use `boto3.client('dynamodb').execute_statement(Statement='...')`. Use `py-partiql-parser` for local PartiQL AST manipulation or in-memory execution.","message":"This library is a *pure Python parser and in-memory executor* of PartiQL. It does *not* directly integrate with `boto3` or AWS services for executing queries against live DynamoDB tables. Users aiming to query live DynamoDB via Python should typically use `boto3`'s `execute_statement` API directly with the PartiQL string. This library is best for parsing, validating, or executing PartiQL against local data structures.","severity":"gotcha","affected_versions":"All versions"},{"fix":"When writing PartiQL for DynamoDB, avoid `AS` aliases in `SELECT` statements. If this parser generates an AST with aliases, consider how that AST will be used downstream, especially if it's meant for AWS services.","message":"A common point of confusion for users of PartiQL with DynamoDB is that DynamoDB's native PartiQL dialect does not support `AS` aliases in `SELECT` clauses, unlike standard SQL. If `py-partiql-parser` supports `AS` in its parsing, the resulting PartiQL string (if re-serialized) or logical intent might not be directly compatible with AWS DynamoDB.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-05T00:00:00.000Z","next_check":"2026-07-04T00:00:00.000Z"}