{"categories":[{"label":"Text Processing","url":"https://skillfed.io/packages/category/text-processing"}],"enrichment":{"capability":"Parses HogQL query expressions into JSON AST format via a hand-rolled Rust parser, delivering 15\u201350\u00d7 performance gains over the C++ ANTLR reference implementation.","skillfed_tags":["parser","rust-extension","query-language"],"use_cases":["Accelerate HogQL query parsing in PostHog analytics pipelines where parse latency is a bottleneck.","Validate HogQL syntax and generate AST for query planning or optimization without invoking the C++ parser.","Drive parser-parity fuzzing and regression testing via the coverage-instrumented build mode (`--features coverage`).","Embed HogQL parsing in Python applications that need fast, deterministic query expression evaluation."],"what_it_does":"hogql_parser_rs is a Rust-based HogQL query parser that emits JSON AST output compatible with PostHog's C++ ANTLR reference parser. It exposes five PyO3 entry points (`parse_expr_json`, `parse_select_json`, `parse_program_json`, `parse_order_expr_json`, `parse_full_template_string_json`) that return JSON strings; parse errors are wrapped in an error envelope that PostHog's `posthog/hogql/json_ast.py` decodes into structured exceptions.\n\nThe parser is hand-rolled using Pratt + recursive descent techniques and deliberately maintains AST shape parity with the C++ parser to enable cross-validation. It ships as a compiled Python extension via maturin, targeting Python 3.12+ across Linux (x86_64/aarch64), macOS (arm64/x86_64), and musl-based systems. The implementation includes a lexer, expression parser with binding-power precedence, and per-rule parsing modules; the C++ ANTLR parser is treated as the source of truth for grammar and AST shape, making this a performance-optimized candidate implementation rather than an independent parser.","worth_installing":"Yes, if you are using PostHog and need faster HogQL parsing. The package is actively maintained, has no known vulnerabilities, and delivers substantial performance gains (15\u201350\u00d7) over the C++ reference. Install friction is moderate due to compiled wheels, but prebuilt binaries cover common platforms. The MIT license is permissive. Only caveat: you must run Python 3.12+, and the parser is designed as a PostHog internal tool\u2014verify that your use case aligns with its role as a C++ parser candidate rather than a standalone HogQL implementation."},"id":"hogql-parser-rs","links":{"html":"https://skillfed.io/packages/hogql-parser-rs","md":"https://skillfed.io/packages/hogql-parser-rs.md","pypi":"https://pypi.org/project/hogql-parser-rs/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-07-12","license_spdx":"MIT","license_treatment":"permissive","name":"hogql-parser-rs","python_support":"supports_current","summary":"Hand-rolled Rust HogQL parser with C++-parity AST output"},"popularity":{"monthly_downloads":2078797,"position":3310,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.3.108"}
