tcxp 0.1.0__py3-none-any.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.
- tcxp/__init__.py +25 -0
- tcxp/_data.py +786 -0
- tcxp/_js.py +746 -0
- tcxp/engine.py +1745 -0
- tcxp/py.typed +0 -0
- tcxp-0.1.0.dist-info/METADATA +124 -0
- tcxp-0.1.0.dist-info/RECORD +9 -0
- tcxp-0.1.0.dist-info/WHEEL +4 -0
- tcxp-0.1.0.dist-info/licenses/LICENSE +202 -0
tcxp/__init__.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""tcxp: Typed Context Protocol v0.1 reference engine (Python port of tcxp.js).
|
|
2
|
+
|
|
3
|
+
>>> import tcxp
|
|
4
|
+
>>> tree = tcxp.parse_uri("!tcxp:/registry/math/eval?expr=eq(add(mul(2,$x),3),9)&$x=3")
|
|
5
|
+
>>> tcxp.execute(tree)['decision']
|
|
6
|
+
True
|
|
7
|
+
|
|
8
|
+
Every function returns the same values as its JavaScript counterpart (parseURI -> parse_uri, ...);
|
|
9
|
+
results are plain dicts and lists with the same keys, so their JSON is identical.
|
|
10
|
+
"""
|
|
11
|
+
from ._js import URIError
|
|
12
|
+
from .engine import (
|
|
13
|
+
CLAUSE_ORDER, CLAUSES, COVERAGE, DEBOUNCE_MS, FACETS, GROUPS, OPS, QUERIES, REGISTRIES, RULES, SCHEME,
|
|
14
|
+
FilterGenerator, TcxpError, base_type, execute, find_slot, full_ddl, identity, parse_uri, resolve_pointer,
|
|
15
|
+
serialize, strict_form, table_ddl, table_inserts, to_json, to_math, to_sql, with_pulse,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
__version__ = "0.1.0"
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"REGISTRIES", "QUERIES", "GROUPS", "OPS", "CLAUSES", "CLAUSE_ORDER", "COVERAGE", "FACETS", "SCHEME", "DEBOUNCE_MS",
|
|
22
|
+
"RULES", "parse_uri", "serialize", "identity", "strict_form", "resolve_pointer", "to_sql", "to_math", "to_json",
|
|
23
|
+
"execute", "with_pulse", "full_ddl", "table_ddl", "table_inserts", "TcxpError", "URIError", "base_type",
|
|
24
|
+
"find_slot", "FilterGenerator", "__version__",
|
|
25
|
+
]
|