Name | py-partiql-parser JSON |
Version |
0.6.1
JSON |
| download |
home_page | None |
Summary | Pure Python PartiQL Parser |
upload_time | 2024-12-25 22:06:41 |
maintainer | None |
docs_url | None |
author | None |
requires_python | None |
license | MIT |
keywords |
parser
pypartiql
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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
```python
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
```python
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](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure.
Raw data
{
"_id": null,
"home_page": null,
"name": "py-partiql-parser",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "parser, pypartiql",
"author": null,
"author_email": "Bert Blommers <info@bertblommers.nl>",
"download_url": "https://files.pythonhosted.org/packages/58/a1/0a2867e48b232b4f82c4929ef7135f2a5d72c3886b957dccf63c70aa2fcb/py_partiql_parser-0.6.1.tar.gz",
"platform": null,
"description": "\n# py-partiql-parser\nA tokenizer/parser/executor for the PartiQL-language, in Python.\n\nMuch beta, such wow. Feel free to raise any issues you encounter.\n\n## S3 Usage\n```python\nimport json\nfrom py_partiql_parser import S3SelectParser\n\noriginal_json = json.dumps({\"a1\": \"b1\", \"a2\": \"b2\"})\nparser = S3SelectParser(source_data={\"s3object\": original_json})\nresult = parser.parse(\"SELECT * FROM s3object\")\n```\n## DynamoDB Usage\n```python\nimport json\nfrom py_partiql_parser import DynamoDBStatementParser\n\nparser = DynamoDBStatementParser(source_data={\"table1\": {\"a1\": {\"S\": \"b1\"}, \"a2\": {\"S\": \"b2\"}}})\nresult = parser.parse(\"SELECT * from table1 WHERE a1 = ?\", parameters=[{\"S\": \"b1\"}])\n```\n\n\n## Meat\nThe important logic of this library can be found here: https://github.com/bblommers/py-partiql-parser/blob/main/py_partiql_parser/_internal/parser.py\n\nIt is implemented as a naive, dependency-free, TDD-first tokenizer.\n\n## Outstanding\n - Support for functions such as `count(*)`\n - Support for CSV conversion. A start has been made in `_internal/csv_converter.py`\n - .. and I'm sure many other things.\n\n## Notes\nThe first iteration of this library was based on the spec, found here: https://partiql.org/assets/PartiQL-Specification.pdf\n\nAWS doesn't follow its own spec though, most notably:\n - 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)\n - `select values` is not supported\n\n\n## Security contact information\n\nTo report a security vulnerability, please use the\n[Tidelift security contact](https://tidelift.com/security).\nTidelift will coordinate the fix and disclosure.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Pure Python PartiQL Parser",
"version": "0.6.1",
"project_urls": {
"Bug Tracker": "https://github.com/getmoto/py-partiql-parser/issues",
"ChangeLog": "https://github.com/getmoto/py-partiql-parser/blob/main/CHANGELOG.md",
"Homepage": "https://github.com/getmoto/py-partiql-parser"
},
"split_keywords": [
"parser",
" pypartiql"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "97840e410c20bbe9a504fc56e97908f13261c2b313d16cbb3b738556166f044a",
"md5": "a4fe4db07738a00a23044f46664d4704",
"sha256": "ff6a48067bff23c37e9044021bf1d949c83e195490c17e020715e927fe5b2456"
},
"downloads": -1,
"filename": "py_partiql_parser-0.6.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "a4fe4db07738a00a23044f46664d4704",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 23520,
"upload_time": "2024-12-25T22:06:39",
"upload_time_iso_8601": "2024-12-25T22:06:39.106368Z",
"url": "https://files.pythonhosted.org/packages/97/84/0e410c20bbe9a504fc56e97908f13261c2b313d16cbb3b738556166f044a/py_partiql_parser-0.6.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "58a10a2867e48b232b4f82c4929ef7135f2a5d72c3886b957dccf63c70aa2fcb",
"md5": "44debdcbd680421f6704a2cec9715e34",
"sha256": "8583ff2a0e15560ef3bc3df109a7714d17f87d81d33e8c38b7fed4e58a63215d"
},
"downloads": -1,
"filename": "py_partiql_parser-0.6.1.tar.gz",
"has_sig": false,
"md5_digest": "44debdcbd680421f6704a2cec9715e34",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17120,
"upload_time": "2024-12-25T22:06:41",
"upload_time_iso_8601": "2024-12-25T22:06:41.327304Z",
"url": "https://files.pythonhosted.org/packages/58/a1/0a2867e48b232b4f82c4929ef7135f2a5d72c3886b957dccf63c70aa2fcb/py_partiql_parser-0.6.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-25 22:06:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "getmoto",
"github_project": "py-partiql-parser",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "py-partiql-parser"
}