Skip to main content

py-partiql-parser

A tokenizer/parser/executor for the PartiQL-language, in Python.

Much beta, such wow. Feel free to raise any issues you encounter.

S3 Usage

import json
from py_partiql_parser import S3SelectParser

original_json = json.dumps({"a1": "b1", "a2": "b2"})
parser = S3SelectParser(source_data={"s3object": original_json})
result = parser.parse("SELECT * FROM s3object")

DynamoDB Usage

import json
from py_partiql_parser import DynamoDBStatementParser

parser = DynamoDBStatementParser(source_data={"table1": {"a1": {"S": "b1"}, "a2": {"S": "b2"}}})
result = parser.parse("SELECT * from table1 WHERE a1 = ?", parameters=[{"S": "b1"}])

Meat

The important logic of this library can be found here: https://github.com/bblommers/py-partiql-parser/blob/main/py_partiql_parser/_internal/parser.py

It is implemented as a naive, dependency-free, TDD-first tokenizer.

Outstanding

  • Support for functions such as count(*)
  • Support for CSV conversion. A start has been made in _internal/csv_converter.py
  • .. and I'm sure many other things.

Notes

The first iteration of this library was based on the spec, found here: https://partiql.org/assets/PartiQL-Specification.pdf

AWS doesn't follow its own spec though, most notably:

  • a file containing a list (with multiple JSON documents) cannot be queried normally (select * returns everything, but you cannot select key for each document in the list)
  • select values is not supported

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

Release files for py-partiql-parser 0.6.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-partiql-parser 0.6.3
File Size Uploaded
py_partiql_parser-0.6.3.tar.gz 17.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-partiql-parser 0.6.3
File Interpreter ABI Platform
py_partiql_parser-0.6.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 41.2 kB

Release files / py_partiql_parser-0.6.3.tar.gz

Download URL py_partiql_parser-0.6.3.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
09cecf916ce6e3da2c050f0cb6106166de42c33d34a078ec2eb19377ea70389a
BLAKE2b-256 checksum
How to use checksums
567aa0f6bda783eb4df8e3dfd55973a1ac6d368a89178c300e1b5b91cd181e5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / py_partiql_parser-0.6.3-py2.py3-none-any.whl

Download URL py_partiql_parser-0.6.3-py2.py3-none-any.whl
Size 23.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
deb0769c3346179d2f590dcbde556f708cdb929059fb654bad75f4cf6e07f582
BLAKE2b-256 checksum
How to use checksums
c933a7cbfccc39056a5cf8126b7aab4c8bafbedd4f0ca68ae40ecb627a2d2cd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.6.3 This release

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

1 release file

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page