py-partiql-parser


Namepy-partiql-parser JSON
Version 0.5.4 PyPI version JSON
download
home_pageNone
SummaryPure Python PartiQL Parser
upload_time2024-04-05 21:30:58
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT
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/db/cb/1a8a3ba98ef891c29b861e1f69c1687217a55abd9036a974e3cf17cd7bac/py_partiql_parser-0.5.4.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.5.4",
    "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": "b4a82c15b432ecd66e0eeedd3104a56b17723c9a8722b6d681be7d3da351223e",
                "md5": "c78f4f7150523a48cde06fde5cb96e1a",
                "sha256": "3dc4295a47da9587681a96b35c6e151886fdbd0a4acbe0d97c4c68e5f689d315"
            },
            "downloads": -1,
            "filename": "py_partiql_parser-0.5.4-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c78f4f7150523a48cde06fde5cb96e1a",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 23350,
            "upload_time": "2024-04-05T21:30:57",
            "upload_time_iso_8601": "2024-04-05T21:30:57.249550Z",
            "url": "https://files.pythonhosted.org/packages/b4/a8/2c15b432ecd66e0eeedd3104a56b17723c9a8722b6d681be7d3da351223e/py_partiql_parser-0.5.4-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dbcb1a8a3ba98ef891c29b861e1f69c1687217a55abd9036a974e3cf17cd7bac",
                "md5": "2de124f06fd1a6b7c5adfc66ddc61322",
                "sha256": "72e043919538fa63edae72fb59afc7e3fd93adbde656718a7d2b4666f23dd114"
            },
            "downloads": -1,
            "filename": "py_partiql_parser-0.5.4.tar.gz",
            "has_sig": false,
            "md5_digest": "2de124f06fd1a6b7c5adfc66ddc61322",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 17057,
            "upload_time": "2024-04-05T21:30:58",
            "upload_time_iso_8601": "2024-04-05T21:30:58.409427Z",
            "url": "https://files.pythonhosted.org/packages/db/cb/1a8a3ba98ef891c29b861e1f69c1687217a55abd9036a974e3cf17cd7bac/py_partiql_parser-0.5.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-05 21:30:58",
    "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"
}
        
Elapsed time: 0.25741s