hogql-parser 1.3.2__cp313-cp313-manylinux_2_28_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of hogql-parser might be problematic. Click here for more details.
- hogql_parser-1.3.2.dist-info/METADATA +36 -0
- hogql_parser-1.3.2.dist-info/RECORD +7 -0
- hogql_parser-1.3.2.dist-info/WHEEL +5 -0
- hogql_parser-1.3.2.dist-info/top_level.txt +2 -0
- hogql_parser-stubs/__init__.pyi +79 -0
- hogql_parser.cpython-313-aarch64-linux-gnu.so +0 -0
- hogql_parser.libs/libantlr4-runtime-db554a3e.so.4.13.1 +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hogql_parser
|
|
3
|
+
Version: 1.3.2
|
|
4
|
+
Summary: HogQL parser for internal PostHog use
|
|
5
|
+
Home-page: https://github.com/PostHog/posthog/tree/master/common/hogql_parser
|
|
6
|
+
Author: PostHog Inc.
|
|
7
|
+
Author-email: hey@posthog.com
|
|
8
|
+
Maintainer: PostHog Inc.
|
|
9
|
+
Maintainer-email: hey@posthog.com
|
|
10
|
+
License: MIT
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
Dynamic: author
|
|
21
|
+
Dynamic: author-email
|
|
22
|
+
Dynamic: classifier
|
|
23
|
+
Dynamic: description
|
|
24
|
+
Dynamic: description-content-type
|
|
25
|
+
Dynamic: home-page
|
|
26
|
+
Dynamic: license
|
|
27
|
+
Dynamic: maintainer
|
|
28
|
+
Dynamic: maintainer-email
|
|
29
|
+
Dynamic: requires-python
|
|
30
|
+
Dynamic: summary
|
|
31
|
+
|
|
32
|
+
# HogQL Parser
|
|
33
|
+
|
|
34
|
+
Blazing fast HogQL parsing. This package can only work in the context of the PostHog Django app, as it imports from `posthog.hogql`.
|
|
35
|
+
|
|
36
|
+
You can test changes locally by running `pip install ./hogql_parser`
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
hogql_parser.cpython-313-aarch64-linux-gnu.so,sha256=4fliVOpL0UZ8ufP1CbSsQ9zVEDsxUsqe_pFzIxr86XU,18589497
|
|
2
|
+
hogql_parser-stubs/__init__.pyi,sha256=nZ7bOGDxG4b78VuWjeqR3fagwJGf92e1gZ9ivPFLXJ8,2585
|
|
3
|
+
hogql_parser.libs/libantlr4-runtime-db554a3e.so.4.13.1,sha256=7yd6hdZMsqBBQZJxXa2zMFlBmtA2comO8z_By3TyOP0,1622025
|
|
4
|
+
hogql_parser-1.3.2.dist-info/METADATA,sha256=qjsE2iOVXVJnwrATgg-t48m8v2zadi78T5whjTmVSCw,1162
|
|
5
|
+
hogql_parser-1.3.2.dist-info/WHEEL,sha256=Z_-WMKendi75Yw57PjPd3p0bWAtfF5SjXZRwFowa7TU,114
|
|
6
|
+
hogql_parser-1.3.2.dist-info/top_level.txt,sha256=_zQ0sWliIKqAQne95N3DqKdj6b7Vo6qG9iVgNgV7t8s,32
|
|
7
|
+
hogql_parser-1.3.2.dist-info/RECORD,,
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
from posthog.hogql.ast import Program, SelectQuery, SelectSetQuery
|
|
2
|
+
from posthog.hogql.base import AST
|
|
3
|
+
|
|
4
|
+
def parse_expr(expr: str, /, *, is_internal: bool = False) -> AST:
|
|
5
|
+
"""Parse the HogQL expression string into an AST.
|
|
6
|
+
|
|
7
|
+
If the expr `is_internal`, spans and notices won't be included in the AST.
|
|
8
|
+
"""
|
|
9
|
+
...
|
|
10
|
+
|
|
11
|
+
def parse_order_expr(expr: str, /, *, is_internal: bool = False) -> AST:
|
|
12
|
+
"""Parse the ORDER BY clause string into an AST.
|
|
13
|
+
|
|
14
|
+
If the expr `is_internal`, spans and notices won't be included in the AST.
|
|
15
|
+
"""
|
|
16
|
+
...
|
|
17
|
+
|
|
18
|
+
def parse_select(expr: str, /, *, is_internal: bool = False) -> SelectQuery | SelectSetQuery:
|
|
19
|
+
"""Parse the HogQL SELECT statement string into an AST.
|
|
20
|
+
|
|
21
|
+
If the expr `is_internal`, spans and notices won't be included in the AST.
|
|
22
|
+
"""
|
|
23
|
+
...
|
|
24
|
+
|
|
25
|
+
def parse_full_template_string(expr: str, /, *, is_internal: bool = False) -> AST:
|
|
26
|
+
"""Parse a Hog template string into an AST.
|
|
27
|
+
|
|
28
|
+
If the expr `is_internal`, spans and notices won't be included in the AST.
|
|
29
|
+
"""
|
|
30
|
+
...
|
|
31
|
+
|
|
32
|
+
def parse_string_literal_text(value: str, /) -> str:
|
|
33
|
+
"""Unquote the string (an identifier or a string literal).
|
|
34
|
+
|
|
35
|
+
If the expr is `internal`, spans and notices won't be included in the AST.
|
|
36
|
+
"""
|
|
37
|
+
...
|
|
38
|
+
|
|
39
|
+
def parse_program(source: str, /, *, is_internal: bool = False) -> Program:
|
|
40
|
+
"""Parse a Hog program.
|
|
41
|
+
|
|
42
|
+
If the expr `is_internal`, spans and notices won't be included in the AST.
|
|
43
|
+
"""
|
|
44
|
+
...
|
|
45
|
+
|
|
46
|
+
def parse_expr_json(expr: str, /, *, is_internal: bool = False) -> str:
|
|
47
|
+
"""Parse the HogQL expression string into a JSON AST.
|
|
48
|
+
|
|
49
|
+
If the expr `is_internal`, spans and notices won't be included in the AST.
|
|
50
|
+
"""
|
|
51
|
+
...
|
|
52
|
+
|
|
53
|
+
def parse_order_expr_json(expr: str, /, *, is_internal: bool = False) -> str:
|
|
54
|
+
"""Parse the ORDER BY clause string into a JSON AST.
|
|
55
|
+
|
|
56
|
+
If the expr `is_internal`, spans and notices won't be included in the AST.
|
|
57
|
+
"""
|
|
58
|
+
...
|
|
59
|
+
|
|
60
|
+
def parse_select_json(expr: str, /, *, is_internal: bool = False) -> str:
|
|
61
|
+
"""Parse the HogQL SELECT statement string into a JSON AST.
|
|
62
|
+
|
|
63
|
+
If the expr `is_internal`, spans and notices won't be included in the AST.
|
|
64
|
+
"""
|
|
65
|
+
...
|
|
66
|
+
|
|
67
|
+
def parse_full_template_string_json(expr: str, /, *, is_internal: bool = False) -> str:
|
|
68
|
+
"""Parse a Hog template string into a JSON AST.
|
|
69
|
+
|
|
70
|
+
If the expr `is_internal`, spans and notices won't be included in the AST.
|
|
71
|
+
"""
|
|
72
|
+
...
|
|
73
|
+
|
|
74
|
+
def parse_program_json(source: str, /, *, is_internal: bool = False) -> str:
|
|
75
|
+
"""Parse a Hog program into a JSON AST.
|
|
76
|
+
|
|
77
|
+
If the expr `is_internal`, spans and notices won't be included in the AST.
|
|
78
|
+
"""
|
|
79
|
+
...
|
|
Binary file
|
|
Binary file
|