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.0.4.tar.gz (47.9 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.0.4-py3-none-any.whl (49.1 kB view details)

Uploaded Python 3

File details

Details for the file esql_parser-9.0.4.tar.gz.

File metadata

  • Download URL: esql_parser-9.0.4.tar.gz
  • Upload date:
  • Size: 47.9 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.0.4.tar.gz
Algorithm Hash digest
SHA256 16b489cd45679561fd953d3af9a91169d3bbfad7748f11b63051117f2e5ef3f2
MD5 8ab276bf9ccbaa721fcc59f9b4657a2b
BLAKE2b-256 99def5ac16ad5f725c983919b7a6d3a2160c0ae54b6d3f3c291b1795cc50eb7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for esql_parser-9.0.4.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.0.4-py3-none-any.whl.

File metadata

  • Download URL: esql_parser-9.0.4-py3-none-any.whl
  • Upload date:
  • Size: 49.1 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.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5291ad0cbe3bb3b6464de778b4720030aeb8a206234b0617644bc751c4d3d9f8
MD5 08e50b35f360c7dc547a66ed79a3ba90
BLAKE2b-256 86711f158a7facc54d3fd041a8ecc9a495c9fedd290b467b166f70b328ab27d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for esql_parser-9.0.4-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