Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

esql_parser-9.1.3.tar.gz (55.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

esql_parser-9.1.3-py3-none-any.whl (55.9 kB view details)

Uploaded Python 3

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

Hashes for esql_parser-9.1.3.tar.gz
Algorithm Hash digest
SHA256 ae19c5218aa1011d5faf2768628ff4a49d259db5ef75b0c006c0290c7d4fa7cf
MD5 575a753cd6cab34c1646e049116d90f7
BLAKE2b-256 f22d57fcd87ee2dab15e076498555bad9e93341304577d39e7fc0b7fbb419f03

See more details on using hashes here.

Provenance

The following attestation bundles were made for esql_parser-9.1.3.tar.gz:

Publisher: publish.yml on mjmbischoff/esql-check

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for esql_parser-9.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dd0ce4975bc000d2b048a7a666664ca5b57fb4871c88246cdf5abd2ef26a741e
MD5 ea2a78d65e7f62b00babb61d4cfd64eb
BLAKE2b-256 7a9a8b02b047f9e83db9c8c240c38f40c574600678cfcc28a7f88fa5345b1b7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for esql_parser-9.1.3-py3-none-any.whl:

Publisher: publish.yml on mjmbischoff/esql-check

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page