Python parser for Elasticsearch ESQL
Project description
esql-parser
A Python package providing an ANTLR4-based parser and lexer for Elasticsearch ESQL (Event Query Language).
The grammar is derived from the official Elasticsearch repository and adapted for the Python ANTLR runtime.
Installation
pip install esql-parser
Usage
from antlr4 import InputStream, CommonTokenStream
from esql_parser.EsqlBaseLexer import EsqlBaseLexer
from esql_parser.EsqlBaseParser import EsqlBaseParser
# Example: parse a simple ESQL query
input_stream = InputStream("FROM logs | STATS count(*) BY host")
lexer = EsqlBaseLexer(input_stream)
token_stream = CommonTokenStream(lexer)
parser = EsqlBaseParser(token_stream)
tree = parser.singleStatement()
print(tree.toStringTree(recog=parser))
Versioning
The version number of esql-parser matches the corresponding Elasticsearch version from which the grammar was taken (e.g. esql-parser==9.1.3 → Elasticsearch 9.1.3).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file esql_parser-9.1.3.tar.gz.
File metadata
- Download URL: esql_parser-9.1.3.tar.gz
- Upload date:
- Size: 55.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae19c5218aa1011d5faf2768628ff4a49d259db5ef75b0c006c0290c7d4fa7cf
|
|
| MD5 |
575a753cd6cab34c1646e049116d90f7
|
|
| BLAKE2b-256 |
f22d57fcd87ee2dab15e076498555bad9e93341304577d39e7fc0b7fbb419f03
|
Provenance
The following attestation bundles were made for esql_parser-9.1.3.tar.gz:
Publisher:
publish.yml on mjmbischoff/esql-check
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
esql_parser-9.1.3.tar.gz -
Subject digest:
ae19c5218aa1011d5faf2768628ff4a49d259db5ef75b0c006c0290c7d4fa7cf - Sigstore transparency entry: 497019857
- Sigstore integration time:
-
Permalink:
mjmbischoff/esql-check@2303231715094274f4571e4a985223bb3d10cdec -
Branch / Tag:
refs/tags/9.1.3 - Owner: https://github.com/mjmbischoff
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2303231715094274f4571e4a985223bb3d10cdec -
Trigger Event:
release
-
Statement type:
File details
Details for the file esql_parser-9.1.3-py3-none-any.whl.
File metadata
- Download URL: esql_parser-9.1.3-py3-none-any.whl
- Upload date:
- Size: 55.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd0ce4975bc000d2b048a7a666664ca5b57fb4871c88246cdf5abd2ef26a741e
|
|
| MD5 |
ea2a78d65e7f62b00babb61d4cfd64eb
|
|
| BLAKE2b-256 |
7a9a8b02b047f9e83db9c8c240c38f40c574600678cfcc28a7f88fa5345b1b7f
|
Provenance
The following attestation bundles were made for esql_parser-9.1.3-py3-none-any.whl:
Publisher:
publish.yml on mjmbischoff/esql-check
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
esql_parser-9.1.3-py3-none-any.whl -
Subject digest:
dd0ce4975bc000d2b048a7a666664ca5b57fb4871c88246cdf5abd2ef26a741e - Sigstore transparency entry: 497019872
- Sigstore integration time:
-
Permalink:
mjmbischoff/esql-check@2303231715094274f4571e4a985223bb3d10cdec -
Branch / Tag:
refs/tags/9.1.3 - Owner: https://github.com/mjmbischoff
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2303231715094274f4571e4a985223bb3d10cdec -
Trigger Event:
release
-
Statement type: