xp-libs-analytics 0.4.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.
- xp_libs_analytics/__init__.py +18 -0
- xp_libs_analytics/engine/__init__.py +1 -0
- xp_libs_analytics/engine/backend.py +379 -0
- xp_libs_analytics/engine/planner.py +450 -0
- xp_libs_analytics/engine/worker.py +121 -0
- xp_libs_analytics/errors/__init__.py +43 -0
- xp_libs_analytics/errors/catalog.json +75 -0
- xp_libs_analytics/errors/codes.py +81 -0
- xp_libs_analytics/ingest/__init__.py +309 -0
- xp_libs_analytics/interfaces.py +70 -0
- xp_libs_analytics/matching/__init__.py +1 -0
- xp_libs_analytics/matching/compiler.py +344 -0
- xp_libs_analytics/matching/diagnostics.py +115 -0
- xp_libs_analytics/matching/models.py +98 -0
- xp_libs_analytics/matching/normalize.py +16 -0
- xp_libs_analytics/matching/patterns.py +71 -0
- xp_libs_analytics/mcp/__init__.py +1 -0
- xp_libs_analytics/mcp/server.py +248 -0
- xp_libs_analytics/models/__init__.py +654 -0
- xp_libs_analytics/parser/__init__.py +142 -0
- xp_libs_analytics/policy/__init__.py +69 -0
- xp_libs_analytics/py.typed +0 -0
- xp_libs_analytics/registry.py +204 -0
- xp_libs_analytics/sdk/__init__.py +259 -0
- xp_libs_analytics/skills/generic-analytics/SKILL.md +236 -0
- xp_libs_analytics/skills/generic-analytics/examples/README.md +69 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/01_count_all.yaml +8 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/02_filter_and_count.yaml +15 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/03_group_stats_and_topk.yaml +21 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/04_nested_or_predicates.yaml +17 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/05_is_missing.yaml +11 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/06_missing_vs_null.yaml +17 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/07_conditional_aggregation.yaml +19 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/08_ratio_if.yaml +16 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/09_tumbling_window.yaml +23 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/10_sliding_window.yaml +32 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/11_explicit_cast.yaml +16 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/12_text_range_distinct.yaml +23 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/13_summary_statistics.yaml +15 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/14_nested_and_not.yaml +20 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/15_conditional_sum.yaml +13 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/16_mixed_types_cast.yaml +17 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/17_relative_last_hour.yaml +15 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/18_string_exact.yaml +11 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/19_string_normalization.yaml +15 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/20_prefix_suffix.yaml +16 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/21_whole_word.yaml +13 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/22_ilike.yaml +11 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/23_rust_regex.yaml +11 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/24_fuzzy.yaml +17 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/25_multi_field_matching.yaml +24 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/26_conditional_fuzzy.yaml +20 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/27_temporal_fuzzy.yaml +38 -0
- xp_libs_analytics/skills/generic-analytics/examples/queries/28_safe_matching_diagnostics.yaml +22 -0
- xp_libs_analytics/skills/generic-analytics/references/errors.md +55 -0
- xp_libs_analytics/skills/generic-analytics/references/query-language-full.md +306 -0
- xp_libs_analytics/skills/generic-analytics/references/query-language.md +39 -0
- xp_libs_analytics/skills/generic-analytics/references/string-matching-full.md +122 -0
- xp_libs_analytics/skills/generic-analytics/references/string-matching.md +11 -0
- xp_libs_analytics-0.4.0.dist-info/METADATA +199 -0
- xp_libs_analytics-0.4.0.dist-info/RECORD +65 -0
- xp_libs_analytics-0.4.0.dist-info/WHEEL +4 -0
- xp_libs_analytics-0.4.0.dist-info/entry_points.txt +2 -0
- xp_libs_analytics-0.4.0.dist-info/licenses/LICENSE +22 -0
- xp_libs_analytics-0.4.0.dist-info/licenses/THIRD_PARTY_NOTICES.md +175 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# String matching in analytics.query/v1
|
|
2
|
+
|
|
3
|
+
Version 0.4.0 adds bounded string predicates to the existing named-snapshot query engine. Query source remains restricted YAML; record input and results remain JSON. Dataset registration, numeric comparisons, null/missing semantics, casts, all 20 aggregates, HAVING and temporal windows keep their existing contracts. No search call is required, and no separate search API is implemented.
|
|
4
|
+
|
|
5
|
+
## Choosing an operator
|
|
6
|
+
|
|
7
|
+
| Operator | Meaning |
|
|
8
|
+
|---|---|
|
|
9
|
+
| eq / ne | Typed equality/inequality; string normalization is optional. Datetime/numeric/Boolean comparisons retain their original typed behavior. |
|
|
10
|
+
| contains / not_contains | Literal substring/complement for non-null strings. Percent, dot and star are ordinary characters. |
|
|
11
|
+
| starts_with / ends_with | Literal prefix/suffix. |
|
|
12
|
+
| word | Literal surrounded by the Rust engine's Unicode word boundaries. |
|
|
13
|
+
| like / ilike | Whole normalized value matched with percent/underscore wildcards; ILIKE is case-insensitive. |
|
|
14
|
+
| regex | Rust regex search, unanchored unless explicitly anchored. |
|
|
15
|
+
| fuzzy | Entire normalized values compared using RapidFuzz ratio, wratio or token_sort. |
|
|
16
|
+
|
|
17
|
+
Null/missing values yield unknown, including under NOT. WHERE selects only true; conditional counts treat unknown as false. Null is never converted to an empty search string. Arrays and objects are not flattened/stringified for matching. Non-string scalar fields require an explicit approved string cast; mixed values retain the existing cast/type policy. Unknown and hidden paths retain DATA_FIELD_UNKNOWN / ACCESS_FIELD_DENIED behavior.
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
version: analytics.query/v1
|
|
21
|
+
dataset: {name: observations}
|
|
22
|
+
filters:
|
|
23
|
+
- field: /actor/name
|
|
24
|
+
op: fuzzy
|
|
25
|
+
value: Peter
|
|
26
|
+
algorithm: ratio
|
|
27
|
+
min_score: 85
|
|
28
|
+
normalization: {case_sensitive: false, unicode: nfkc, trim: true}
|
|
29
|
+
aggregations:
|
|
30
|
+
- {op: count, as: matching_records}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Fuzzy similarity is not probability, confidence or real-world identity. ratio uses normalized Indel similarity; token_sort compares token-sorted strings; wratio includes RapidFuzz's weighting/partial-match heuristics. Processing is explicit: the engine owns normalization and passes processor=None. The inclusive cutoff uses the actual floating-point score without rounding. Only displayed scores are rounded to six decimal places. No nickname expansion, entity merging, identity assignment or inference is available.
|
|
34
|
+
|
|
35
|
+
## Normalization
|
|
36
|
+
|
|
37
|
+
Optional normalization has strict keys case_sensitive (default true), unicode (none/nfc/nfkc; default none), trim (default false). Processing order is Unicode normalization, whitespace trim, then Python casefold when case-insensitive. Apply the same processing to search text and candidate values. Records, schema, groups and display values retain their original content.
|
|
38
|
+
|
|
39
|
+
Casefold can expand characters: Straße equals STRASSE with case-insensitive literal equality, and sharp-s occupies two normalized code points. LIKE underscore counts normalized Unicode code points, including newline, rather than grapheme clusters. Query and candidate length budgets also apply after normalization. Empty contains/not_contains/prefix/suffix/word/fuzzy terms are rejected; typed equality accepts an empty string.
|
|
40
|
+
|
|
41
|
+
Regex is the deliberate exception: patterns are never Unicode-normalized, trimmed or casefolded. Regex rejects unicode other than none and trim=true. normalization.case_sensitive=false enables Rust's (?i) behavior over original input strings. Regex Unicode case handling follows Rust regex, not full-string Python casefold expansion. Inline i flags, global or scoped, are allowed; other flags, flag disabling, lookaround and backreferences are rejected. Explicit case-sensitive normalization conflicts with an inline i flag. Regex validity is checked with installed Polars, never Python re. Pattern errors use canonical messages without echoing patterns.
|
|
42
|
+
|
|
43
|
+
Whole-word matching means Unicode regex-engine words: Peter Johnson, Peter-Johnson, Peter's and Peter@example.invalid contain the word Peter; Peterson and Peter_Johnson do not. Combining marks participate in word membership. Han letters are word characters; this is not language-specific tokenization. Normalize explicitly when composed/decomposed spellings should match.
|
|
44
|
+
|
|
45
|
+
## LIKE escaping and regex
|
|
46
|
+
|
|
47
|
+
LIKE translates percent to any sequence and underscore to one normalized code point. Backslash escapes only percent, underscore or backslash. Invalid/dangling escapes fail MATCH_PATTERN_INVALID. All literal characters are escaped before translation; generated patterns use absolute A/z anchors and DOTALL so wildcards include newline. Prefer single-quoted YAML for backslashes:
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
filters:
|
|
51
|
+
- {field: /text, op: like, value: 'Pet\%'} # literal Pet%
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Peter without wildcards matches the whole value only. '%Peter%' matches a substring. contains with value 'Pet%' treats percent literally. ILIKE forces case-insensitive matching and rejects explicitly case_sensitive=true; normalization may still request NFC/NFKC or trimming. LIKE may explicitly be case-insensitive, but ILIKE expresses that intent more clearly.
|
|
55
|
+
|
|
56
|
+
Regex supports explicit anchors and classes, for example value: '(?i)^peter[._-]'. Raw patterns are capped at 512 UTF-8 bytes. Generated word/LIKE regex has a separate bounded size derived from the 1024-character literal budget. By default, patterns that match the empty string (such as percent-only LIKE or dot-star regex) fail MATCH_REGEX_POLICY. Trusted hosts can explicitly allow catch-all patterns; result, candidate and execution budgets still apply. Other broad nonempty patterns remain bounded by input and runtime budgets.
|
|
57
|
+
|
|
58
|
+
## Multi-field predicates and composition
|
|
59
|
+
|
|
60
|
+
```yaml
|
|
61
|
+
filters:
|
|
62
|
+
- match:
|
|
63
|
+
fields: [/actor/name, /actor/email]
|
|
64
|
+
patterns:
|
|
65
|
+
- {op: word, value: Peter}
|
|
66
|
+
- {op: fuzzy, value: Pter, algorithm: ratio, min_score: 85}
|
|
67
|
+
normalization: {case_sensitive: false, unicode: nfkc, trim: true}
|
|
68
|
+
mode: any
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Fields are 1–10 unique, discovered JSON Pointers. Patterns are 1–10 strict rules: eq, contains, not_contains, starts_with, ends_with, word, like, ilike, regex or fuzzy. Patterns cannot contain field or normalization; normalization belongs to the parent match node. Only mode:any exists. It performs three-valued OR across every field/rule pair, and each record contributes once. Missing-only records remain unknown under outer NOT. Use existing AND/OR/NOT nodes to express other logic; a broad not_contains alternative is not identity exclusion.
|
|
72
|
+
|
|
73
|
+
The same recursive predicate is accepted in filters and count_if/sum_if/avg_if/ratio_if.where. HAVING still accepts aggregate-output aliases only; source matching and normalization options there are rejected. Grouping uses original source values; output sorting and limits follow aggregation. Time filtering uses existing explicit timestamp casts, one injected UTC clock and half-open bounds. Tumbling/sliding interval names and sparse-data semantics are unchanged.
|
|
74
|
+
|
|
75
|
+
## Complete selection and bounded execution
|
|
76
|
+
|
|
77
|
+
The planner authorizes every referenced path before matching, including OR branches. Cast/type validation still examines all admitted rows; a selective filter cannot conceal a bad cast. Time and provably independent nonfuzzy conjuncts may reduce the candidate universe. A child of fuzzy OR/NOT is never pushed down independently. Conditional predicates do not restrict their own aggregate denominator.
|
|
78
|
+
|
|
79
|
+
RapidFuzz scores every eligible distinct normalized candidate per field. Duplicate values reuse scores inside a query; membership is a typed native Polars expression. Normalization maps are bounded distinct-value mappings, not Python row UDFs. No value/scoring cache survives a query, and resolved snapshot leases survive replacement/unregister. Validation/explain checks syntax, permissions, types, candidate/comparison budgets and normalization without executing RapidFuzz scoring.
|
|
80
|
+
|
|
81
|
+
| Host limit | Default |
|
|
82
|
+
|---|---:|
|
|
83
|
+
| Authored predicate nodes / depth | 32 / 4 |
|
|
84
|
+
| Expanded match field-rule pairs within node budget | 32, further reduced by surrounding predicates |
|
|
85
|
+
| Fields / patterns per match | 10 / 10 |
|
|
86
|
+
| Additional global matching work cap | 40, including conditional predicates |
|
|
87
|
+
| Raw and normalized search characters | 1024 |
|
|
88
|
+
| Candidate string characters, before/after normalization | 1024 |
|
|
89
|
+
| Raw regex bytes | 512 |
|
|
90
|
+
| Distinct normalized fuzzy candidates per field/configuration | 10,000 |
|
|
91
|
+
| Fuzzy comparisons per query, including conditional work | 100,000 |
|
|
92
|
+
| Normalized mapping bytes per query | 8 MiB |
|
|
93
|
+
| Minimum normalized fuzzy term / similarity | 3 characters / 70 |
|
|
94
|
+
| Diagnostic top_values / distinct diagnostic entries | 20 / 10,000 |
|
|
95
|
+
|
|
96
|
+
These are initial measured defaults, not universal safety guarantees. Hosts can tighten Limits; YAML cannot raise them. Budgets fail with a canonical error, never return a partially scored aggregate. limit and top_values are output-only. Disabling the trusted host's pushdown optimization can increase conservative cost/rejections, but completed selections keep identical semantics. Group/window/expansion/result and owner quotas remain independently enforced.
|
|
97
|
+
|
|
98
|
+
Regex/fuzzy queries and requested diagnostics automatically use the OS-limited worker by default, even on a normally in-process SDK engine. Use a __main__ guard for executable Windows applications. A trusted host may explicitly disable force_matching_isolation for controlled in-process benchmarking; untrusted deployments should retain it. Planning remains bounded host work; scoring and arbitrary regex scans run within the killable worker. Worker memory/time limits return errors, never partial aggregates.
|
|
99
|
+
|
|
100
|
+
## Matching diagnostics and privacy
|
|
101
|
+
|
|
102
|
+
```yaml
|
|
103
|
+
options:
|
|
104
|
+
matching_details:
|
|
105
|
+
include: true
|
|
106
|
+
top_values: 10
|
|
107
|
+
include_raw_values: false
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
The optional matching envelope reports used, predicate_complete, versions, comparison counts and cost scope. Detailed evidence is computed from positive matching-leaf hits among rows remaining after ALL outer filters, before grouping, HAVING and window expansion. diagnostic_scope explicitly names this narrower scope. It does not imply conditional-aggregate eligibility or count NOT-complements as positive matches. Each source row is counted once per field/original value, even when multiple rules match. Per-field frequencies are not summed to obtain the query's record count.
|
|
111
|
+
|
|
112
|
+
Top values report field, frequency, primary match_type, effective normalization, all matched_rules, optional actual fuzzy score/algorithm, and truncation flags. Primary precedence is exact, word, prefix/suffix, contains, LIKE/ILIKE, regex, fuzzy. Negated literal rules share their corresponding family precedence and have explicit negative types. Fuzzy-only entries sort by score descending, frequency descending, normalized value, field path, then original value. There is no fabricated score for literal matches.
|
|
113
|
+
|
|
114
|
+
By default value is null and value_ref is an HMAC using an internal snapshot-derived secret. References are stable within a snapshot, differ across snapshots/contexts and cannot be reproduced from the raw value alone. Errors/logs do not disclose candidates. Raw output requires BOTH Limits(allow_match_raw_values=True) and Principal.match_raw_fields containing every matching field, in addition to ordinary field authorization. YAML cannot grant this permission. Denied disclosure returns MATCH_DIAGNOSTICS_UNAUTHORIZED.
|
|
115
|
+
|
|
116
|
+
Diagnostic truncation sets diagnostics_truncated=true and complete=false for diagnostics only. predicate_complete remains true and every selected record still contributes to aggregates. Exceeding diagnostic cardinality or result-byte limits fails explicitly. No diagnostics can silently turn an analytical query into top-N selection.
|
|
117
|
+
|
|
118
|
+
## Errors and recovery
|
|
119
|
+
|
|
120
|
+
One catalog remains authoritative. New distinctions are MATCH_PATTERN_INVALID, MATCH_REGEX_INVALID, MATCH_REGEX_POLICY, MATCH_NORMALIZATION_INVALID, MATCH_FUZZY_ALGORITHM_INVALID, MATCH_FUZZY_THRESHOLD_INVALID, MATCH_FUZZY_QUERY_TOO_SHORT, MATCH_CANDIDATE_BUDGET_EXCEEDED, MATCH_COMPLEXITY_BUDGET_EXCEEDED, MATCH_DIAGNOSTICS_UNAUTHORIZED and MATCH_ENTITY_INFERENCE_UNSUPPORTED. Existing field/type/operator/authorization errors are reused. There are 73 catalog entries total.
|
|
121
|
+
|
|
122
|
+
Use analytics_error_info for exact repair guidance. After invalid Rust syntax, use a supported pattern or literal predicate. After a budget failure, narrow authorized time/nonfuzzy scope only with an explicit statement that the question has changed. Never claim an original-scope aggregate was complete after narrowing. After authorization denial, stop. Entity/alias/identity requests remain unsupported; observed values can resemble each other without belonging to the same person. See examples 18–28 and the agent skill.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Matching reference index
|
|
2
|
+
|
|
3
|
+
Read analytics://string-matching/v1 for the complete contract and examples 18–28 from analytics://examples/index. These resources are allowlisted product documentation, not arbitrary file access. No search call is required before an analytical query.
|
|
4
|
+
|
|
5
|
+
Use eq for exact observed values; contains/prefix/suffix for literal fragments; word for Rust Unicode word boundaries; ILIKE for percent/underscore whole-value wildcards; regex for bounded Rust syntax; fuzzy for explicit ratio/wratio/token_sort similarity. Normalization is Unicode NFC/NFKC, trim, then casefold, and affects matching only. Regex accepts case handling but rejects Unicode normalization/trimming; never casefold regex syntax.
|
|
6
|
+
|
|
7
|
+
Fuzzy requires an explicit algorithm and inclusive min_score, normally ratio/85. Default policy requires at least three normalized query characters and score >=70. Every eligible distinct value is scored or the query fails. Neither result limit nor diagnostic top_values can approximate an aggregate.
|
|
8
|
+
|
|
9
|
+
Multi-field syntax is match: {fields: [/a, /b], patterns: [{op: word, value: Peter}], mode: any}. Parent normalization applies to every pattern. Field/rule hits do not multiply records; missing-only matches remain unknown under NOT. The node is allowed in filters and conditional aggregates, with existing grouping/HAVING/time semantics. HAVING accepts output aliases only.
|
|
10
|
+
|
|
11
|
+
Diagnostic scope is positive leaf hits among rows after all outer filters, before grouping/window expansion. Default values are HMAC references; raw display needs explicit host and field permission. Diagnostic truncation is not predicate truncation. Frequency counts source records per field/value, not identities or window memberships. A fuzzy score is similarity, never identity confidence; entity/nickname/alias inference is unsupported.
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: xp-libs-analytics
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: Schema-on-read, in-memory analytics for agent-generated YAML queries
|
|
5
|
+
Project-URL: Source, https://github.com/rrodrigoa/xp-libs-analytics
|
|
6
|
+
Project-URL: Issues, https://github.com/rrodrigoa/xp-libs-analytics/issues
|
|
7
|
+
Project-URL: Documentation, https://github.com/rrodrigoa/xp-libs-analytics/blob/main/README.md
|
|
8
|
+
Author: Generic In-Memory Analytics contributors
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
License-File: THIRD_PARTY_NOTICES.md
|
|
12
|
+
Keywords: agents,analytics,in-memory,json,mcp,polars,yaml
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
20
|
+
Requires-Python: >=3.12
|
|
21
|
+
Requires-Dist: polars<2.2,>=2.1
|
|
22
|
+
Requires-Dist: pydantic<3,>=2.14
|
|
23
|
+
Requires-Dist: pyyaml<7,>=6.0.2
|
|
24
|
+
Requires-Dist: rapidfuzz<3.15,>=3.14.6
|
|
25
|
+
Requires-Dist: tzdata>=2025.2; sys_platform == 'win32'
|
|
26
|
+
Provides-Extra: agent-eval
|
|
27
|
+
Requires-Dist: fastmcp<4.2,>=4.1.6; extra == 'agent-eval'
|
|
28
|
+
Requires-Dist: inspect-ai==0.3.287; extra == 'agent-eval'
|
|
29
|
+
Requires-Dist: openai==3.46.0; extra == 'agent-eval'
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
32
|
+
Requires-Dist: hypothesis>=6; extra == 'dev'
|
|
33
|
+
Requires-Dist: mypy>=1.15; extra == 'dev'
|
|
34
|
+
Requires-Dist: pip-audit>=2.8; extra == 'dev'
|
|
35
|
+
Requires-Dist: psutil>=7; extra == 'dev'
|
|
36
|
+
Requires-Dist: pytest-asyncio<3,>=1; extra == 'dev'
|
|
37
|
+
Requires-Dist: pytest-cov<8,>=6; extra == 'dev'
|
|
38
|
+
Requires-Dist: pytest<10,>=8; extra == 'dev'
|
|
39
|
+
Requires-Dist: ruff>=0.9; extra == 'dev'
|
|
40
|
+
Requires-Dist: twine>=6; extra == 'dev'
|
|
41
|
+
Requires-Dist: types-pyyaml>=6; extra == 'dev'
|
|
42
|
+
Provides-Extra: mcp
|
|
43
|
+
Requires-Dist: fastmcp<4.2,>=4.1.6; extra == 'mcp'
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
|
|
46
|
+
# XP Libs Analytics
|
|
47
|
+
|
|
48
|
+
A Python library for bounded, in-memory snapshot analytics over JSON records with unknown, heterogeneous schemas. Queries are restricted YAML, validated with strict Pydantic models and compiled to fixed Polars expressions. The optional standalone FastMCP adapter supplies tools, an agent skill, and 28 read-only query examples.
|
|
49
|
+
|
|
50
|
+
Python 3.12+ · MIT · Import: `xp_libs_analytics` · Distribution: `xp-libs-analytics`
|
|
51
|
+
|
|
52
|
+
The distribution uses hyphens for package indexes and `pip`; Python imports use underscores because hyphens are not valid identifiers. The previous `agent_analytics` import and `agent-analytics-mcp` distribution/command have been replaced.
|
|
53
|
+
|
|
54
|
+
## Install and run
|
|
55
|
+
|
|
56
|
+
From this checkout:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
python -m pip install .
|
|
60
|
+
python -m pip install '.[mcp]' # optional MCP adapter
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
from xp_libs_analytics import AnalyticsEngine
|
|
65
|
+
|
|
66
|
+
engine = AnalyticsEngine()
|
|
67
|
+
my_data = [{"value": 10}, {"value": 20}, {"value": None}, {}]
|
|
68
|
+
engine.register_records(name="observations", records=my_data)
|
|
69
|
+
engine.register_records("events", [{"kind": "created"}])
|
|
70
|
+
print(engine.list_datasets())
|
|
71
|
+
|
|
72
|
+
query_yaml = """version: analytics.query/v1
|
|
73
|
+
dataset:
|
|
74
|
+
name: observations
|
|
75
|
+
aggregations:
|
|
76
|
+
- {op: count, as: records}
|
|
77
|
+
- {op: avg, field: /value, as: mean}
|
|
78
|
+
- {op: missing_count, field: /value, as: missing}
|
|
79
|
+
"""
|
|
80
|
+
result = engine.query_yaml(query_yaml)
|
|
81
|
+
print(result["rows"]) # [{"records": 4, "mean": 15.0, "missing": 1}]
|
|
82
|
+
|
|
83
|
+
# Atomic publication: future queries resolve the new snapshot.
|
|
84
|
+
engine.replace_records("observations", [{"value": 30}])
|
|
85
|
+
engine.unregister_dataset("events")
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Logical dataset names are symbolic references, independent of Python variable names, paths and opaque internal snapshot IDs. Registering a duplicate name fails; use `replace_records` to update it. Each query resolves exactly one immutable snapshot. Running queries retain their resolved snapshot through replacement, unregister or context closure; storage remains charged until their leases are released. Result metadata reports the logical name and resolved revision. Revisions increase within a context and can have gaps; re-registering a removed name never reuses an old revision. Optional `expected_revision` on replacement/unregister rejects stale updates.
|
|
89
|
+
|
|
90
|
+
For independent namespaces in one application:
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
with engine.create_context() as ctx:
|
|
94
|
+
ctx.register_records("observations", [{"value": 7}])
|
|
95
|
+
print(ctx.query_yaml(query_yaml)["rows"])
|
|
96
|
+
# ctx closes and removes its bindings; engine's observations remain independent.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Names use 1–64 ASCII letters, digits, underscores or hyphens, starting with a letter. Unknown names return `DATASET_NAME_UNKNOWN` without revealing other contexts. Expired snapshots and stale expected revisions return `DATASET_SNAPSHOT_STALE`. Expired bindings are omitted from discovery; replace or unregister them to reuse resources. `register_stream(name, source)` is reserved and always rejects with `QUERY_UNSUPPORTED_FEATURE`; streaming is not implemented.
|
|
100
|
+
|
|
101
|
+
Input accepts JSON objects, arrays of objects, NDJSON, or Python iterables of JSON mappings. Admission copies records into immutable owner-scoped snapshots. Schema discovery examines every admitted record and returns no raw samples. Fields use RFC 6901 pointers; `/a~1b` addresses key `a/b`. Arrays remain opaque.
|
|
102
|
+
|
|
103
|
+
## Query features
|
|
104
|
+
|
|
105
|
+
| Feature | Supported V1 behavior |
|
|
106
|
+
|---|---|
|
|
107
|
+
| Predicates | 22 typed leaf operators; nested `and`, `or`, `not`; multi-field `match`; three-valued null logic |
|
|
108
|
+
| Aggregates | 20 count, distinct, numeric, linear quantile, sample variance, and conditional operations |
|
|
109
|
+
| Grouping | Up to four scalar dimensions; missing and explicit null groups remain separate |
|
|
110
|
+
| Time | Explicit RFC3339/epoch casts, absolute or relative UTC ranges, epoch-aligned tumbling/sliding windows |
|
|
111
|
+
| Results | HAVING, stable sorting, limit/truncation, strict JSON and quality/provenance evidence |
|
|
112
|
+
| Errors | 73 catalog codes, one canonical packaged message catalog, safe diagnostic locations |
|
|
113
|
+
|
|
114
|
+
See the [query language](docs/query-language.md), [examples](examples/README.md), and [agent skill](skills/generic-analytics/SKILL.md). `NO_DATA` reports absent matching observations. `INSUFFICIENT_DATA` applies the host's minimum sample policy. Unknown sampling cadence yields `coverage: UNKNOWN`; counts do not imply duration.
|
|
115
|
+
|
|
116
|
+
Mixed scalar types require explicit casts. Boolean values are never numeric. Null/missing values are excluded from numeric samples; cast failures configured as null are counted and warned. Integer sums detect overflow. Float statistics reject integer samples beyond exact float64 integer precision. V1 does not offer exact decimal analytics. String matching defaults to case-sensitive literal semantics, with explicit Unicode/case normalization, word, LIKE/ILIKE, bounded Rust regex and RapidFuzz similarity options. See the [matching contract](docs/string-matching.md).
|
|
117
|
+
|
|
118
|
+
## Matching observed values
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
version: analytics.query/v1
|
|
122
|
+
dataset: {name: observations}
|
|
123
|
+
filters:
|
|
124
|
+
- match:
|
|
125
|
+
fields: [/actor/name, /actor/email]
|
|
126
|
+
patterns:
|
|
127
|
+
- {op: word, value: Peter}
|
|
128
|
+
- {op: fuzzy, value: Pter, algorithm: ratio, min_score: 85}
|
|
129
|
+
normalization: {case_sensitive: false, unicode: nfkc, trim: true}
|
|
130
|
+
mode: any
|
|
131
|
+
aggregations:
|
|
132
|
+
- {op: count, as: matching_records}
|
|
133
|
+
options:
|
|
134
|
+
matching_details: {include: true, top_values: 5, include_raw_values: false}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Discover paths before authoring this query. Every eligible distinct fuzzy candidate is evaluated within host budgets; limit/top_values never approximate an aggregate. A record contributes once even when multiple fields/rules match. Diagnostics are redacted by default; raw display requires host and field permissions. Similarity does not infer identities, merge people or expand nicknames. All new predicates also work in conditional aggregates and with existing grouping, HAVING and windows. Examples 18–28 are runnable against synthetic matching data. RapidFuzz is a required MIT-licensed core dependency; FastMCP and Inspect AI remain optional.
|
|
138
|
+
|
|
139
|
+
Regex/fuzzy and requested matching diagnostics automatically use the bounded worker by default. Keep the documented Windows __main__ guard. Trusted benchmarking can explicitly disable force_matching_isolation; untrusted hosts should retain it. No search API or separate matching tools are needed.
|
|
140
|
+
|
|
141
|
+
## Bounds and deployment
|
|
142
|
+
|
|
143
|
+
Defaults are declared in `Limits` and returned by `engine.capabilities()`: 8 MiB input, 100,000 rows, 256 paths, depth 12, 128 KiB per record, eight named bindings per context and eight active snapshots per principal in a shared store, 64 MiB admitted storage per store, 900-second leases, 64 KiB YAML, 10,000 groups/windows/distinct values, overlap at most 12, 500 result rows and 1 MiB results. Queries share owner quotas within a store (120/minute, two concurrent executions). Hosts may tighten limits; requests cannot change them.
|
|
144
|
+
|
|
145
|
+
The default SDK runs inside a **trusted host process**. Use `AnalyticsEngine(isolated=True)` for untrusted execution: a fresh worker has a 15-second wall deadline, CPU ceiling and 1 GiB absolute memory ceiling (POSIX address-space rlimits / Windows Job Object commit limits). Linux Polars needs native virtual mappings beyond 512 MiB even for small numeric queries; measured additional RSS is much lower. Use a `__main__` guard around executable application entry points on Windows. Parsing and bounded snapshot admission remain in the host process. Containers additionally control network/filesystem privileges; see [security](SECURITY.md) and [architecture](docs/architecture.md).
|
|
146
|
+
|
|
147
|
+
V1 evaluates one snapshot per query. It rejects joins, unions, continuous queries, external sources/sinks, SQL, UDFs, unbounded regex and executable expressions. Dense windows are supported only without grouping, with a bounded grid. In-flight executions keep their admitted snapshot; unregister blocks subsequent name resolution. Foreign-context names and unknown names receive the same unknown-name error. Scope failures receive ACCESS_DENIED.
|
|
148
|
+
|
|
149
|
+
## MCP
|
|
150
|
+
|
|
151
|
+
The YAML parser, typed query models, semantic planner and execution engine belong to the core library. They do not import FastMCP or Inspect AI. A developer can expose the SDK using any MCP implementation or another transport:
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
from xp_libs_analytics import AnalyticsEngine
|
|
155
|
+
|
|
156
|
+
# Construct per trusted application principal; do not accept identity from agent arguments.
|
|
157
|
+
analytics = AnalyticsEngine()
|
|
158
|
+
analytics.register_records("observations", [{"value": 2}, {"value": 4}])
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
def query_tool(query_yaml: str) -> dict:
|
|
162
|
+
return analytics.query_yaml(query_yaml)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def validation_tool(query_yaml: str) -> dict:
|
|
166
|
+
return analytics.validate_query(query_yaml)
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Register those callables with your chosen server. Select the authorized execution context and identity in the host, enforce transport authentication, and use `isolated=True` for untrusted execution. The bundled FastMCP adapter is an optional convenience layer.
|
|
170
|
+
|
|
171
|
+
```sh
|
|
172
|
+
xp-libs-analytics --help
|
|
173
|
+
xp-libs-analytics # stdio; uploads disabled
|
|
174
|
+
xp-libs-analytics --allow-uploads # bounded local uploads
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Tools: `analytics_capabilities`, `analytics_list_datasets`, `analytics_load_json`, `analytics_describe`, `analytics_validate_query`, `analytics_explain_query`, `analytics_query`, `analytics_unregister_dataset`, `analytics_error_info`. Query tools accept `query_yaml: str`. Core imports do not load FastMCP.
|
|
178
|
+
|
|
179
|
+
The local stdio server inherits its launcher's authority; one process is one local context. The default backend uses isolated workers. HTTP access fails closed unless a host supplies an authenticated `principal_resolver` and configures FastMCP transport authentication. A host-supplied `engine` deliberately selects that engine's context for local use. Hosted sessions can supply `context_resolver`, a trusted callable returning their authorized engine/context. No tool accepts a context ID or principal. The identity resolver creates distinct namespaces per authenticated principal and reapplies current field/scopes policy per request. The adapter caps cached principal contexts at 128; restarting clears local state. It is not a turnkey public multi-tenant service.
|
|
180
|
+
|
|
181
|
+
## Development and evidence
|
|
182
|
+
|
|
183
|
+
Optional real-model evaluations use Inspect AI and the actual MCP adapter. From this checkout, install `python -m pip install -e '.[dev,mcp,agent-eval]'`, then run `python -m evals.agent_skill.cli validate`. Live evaluation accepts the model connection only at execution time; see [evaluation usage](evals/agent_skill/README.md). Normal CI runs offline evaluator tests and excludes live model tests.
|
|
184
|
+
|
|
185
|
+
```sh
|
|
186
|
+
python -m pip install -c requirements-lock.txt -e '.[dev,mcp,agent-eval]'
|
|
187
|
+
ruff check .
|
|
188
|
+
ruff format --check .
|
|
189
|
+
mypy src/xp_libs_analytics
|
|
190
|
+
pytest --cov=xp_libs_analytics --cov=evals.agent_skill --cov-branch --cov-report=json --cov-report=xml --cov-fail-under=90
|
|
191
|
+
python scripts/check_critical_coverage.py coverage.json
|
|
192
|
+
python examples/run_examples.py --all
|
|
193
|
+
python scripts/resource_probe.py
|
|
194
|
+
python scripts/benchmark.py
|
|
195
|
+
python -m build
|
|
196
|
+
python -m twine check dist/*
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
[Verification evidence](docs/evidence/verification.md) records actual local tests, coverage, benchmarks, audit and build hashes. GitHub checks, protected environments and TestPyPI/PyPI publication require maintainer configuration; this checkout makes no publication claim. See [releasing](docs/releasing.md).
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
xp_libs_analytics/__init__.py,sha256=YHy3a-Hd5VR9h0JZEy1JVUu-yT2h2wGZ2ZiiZpKxhyQ,537
|
|
2
|
+
xp_libs_analytics/interfaces.py,sha256=gD34wSiWyOh4fk5emPYSexZ_U1eCKXMQ0xnOrsUhXcw,1719
|
|
3
|
+
xp_libs_analytics/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
xp_libs_analytics/registry.py,sha256=edtuxRNHxAgDHGmQXWUn75J_wuorKDrwE-Gr74vqNZs,6994
|
|
5
|
+
xp_libs_analytics/engine/__init__.py,sha256=3IrF9SmHEBhYGoyhITqLfsQKQ6ec05iLC8bSv38-Aec,60
|
|
6
|
+
xp_libs_analytics/engine/backend.py,sha256=OYtiXIGOtKTYDs2iaRI9dt14afkKea9WgfblW3kthUU,14496
|
|
7
|
+
xp_libs_analytics/engine/planner.py,sha256=Fj5Z_xmgdF4mMLjbd9GyI-oGCkVq2yPI5beaMy63hO0,18624
|
|
8
|
+
xp_libs_analytics/engine/worker.py,sha256=n-3XWRDkMZ8qnab9Sr6EXKtfedoF-NYzY8CqbcbWuEo,4394
|
|
9
|
+
xp_libs_analytics/errors/__init__.py,sha256=PZsmj3dVyXHL5VSo8rRlYLE-d2BQosYRZl4yOE_E_vc,1254
|
|
10
|
+
xp_libs_analytics/errors/catalog.json,sha256=2WgOrEE2tVbtC20Yi_3AA6XhEvIU9Y9LIWETz1CSKQU,16550
|
|
11
|
+
xp_libs_analytics/errors/codes.py,sha256=byiSiygGjN_my81dKVlvyxkSyxtr2OSUsoRDa_YFeaU,4007
|
|
12
|
+
xp_libs_analytics/ingest/__init__.py,sha256=DbNAgfT1ATaI603gpwnqqrvKmEuMP47RH9XItj4TT8s,11317
|
|
13
|
+
xp_libs_analytics/matching/__init__.py,sha256=oMTrWSoWwa4dpIREmHgCLT8d6Z85gmWgxy2PJYrnQxc,82
|
|
14
|
+
xp_libs_analytics/matching/compiler.py,sha256=6J3C9Z-PO6kzkMwTRT-jercmaBPedmn6u7OFAUR90zc,13061
|
|
15
|
+
xp_libs_analytics/matching/diagnostics.py,sha256=8k8DvnxzzEqOKEedm2N2Ur1AMe8iCwBKcsXtTHzX02U,3916
|
|
16
|
+
xp_libs_analytics/matching/models.py,sha256=EXfxw_i_m-ul9S8jWJzzE-y3qJRV2yYYxj_VFsyAZyg,2411
|
|
17
|
+
xp_libs_analytics/matching/normalize.py,sha256=PEfIde3l3vU_rrXp2QIPAI7Mbq1h2Tda_6X3qT9RXBU,562
|
|
18
|
+
xp_libs_analytics/matching/patterns.py,sha256=BulTmWKNTqYVhMZB14hDWHM75yw-1tdbxKLflrSRNP0,2571
|
|
19
|
+
xp_libs_analytics/mcp/__init__.py,sha256=fwRX4MyG_aRtdnVw1z-eCY_fw2L-4hwNwN1DyW-c-Nc,81
|
|
20
|
+
xp_libs_analytics/mcp/server.py,sha256=Gw32AgQVq22BnXpz_zRwGBAm-UL1JSIxigNKaXAdiIg,9687
|
|
21
|
+
xp_libs_analytics/models/__init__.py,sha256=Lwi0WBHuy7ECoJeGtb7SH9wFgOUTjT1vD-1Q2XZDrnY,14947
|
|
22
|
+
xp_libs_analytics/parser/__init__.py,sha256=bhSr0ZdkEyOw9Tc6hucHukjXEj_6eyWOmfWBATWX1q4,6071
|
|
23
|
+
xp_libs_analytics/policy/__init__.py,sha256=3nR0bfvPLWEWEU9msQVhcEHlItItX7-RgiB5xFS4Mbk,2188
|
|
24
|
+
xp_libs_analytics/sdk/__init__.py,sha256=vrsfGQXzwNiU8GZYqJl4ryLm0VkZ5WH7zbP_Pu4qNWg,10206
|
|
25
|
+
xp_libs_analytics/skills/generic-analytics/SKILL.md,sha256=gFxN3VWP6k-IyzgUOGxo4edmU1rfHv798mI8I62RbfQ,19620
|
|
26
|
+
xp_libs_analytics/skills/generic-analytics/references/errors.md,sha256=hIoV4PwMXYbQW2aRLmD9yT3IArlWBDf40iXzsPY2XSU,3042
|
|
27
|
+
xp_libs_analytics/skills/generic-analytics/references/query-language.md,sha256=8Vz7fE_HDP1MFKk5K5FInDzBWRc3QQGQqQLm_W0bQB8,3249
|
|
28
|
+
xp_libs_analytics/skills/generic-analytics/references/string-matching.md,sha256=0dfmoIiEpYizXoRtodrxE1ZDGZLV4p9cCHuWT_OYRGE,1842
|
|
29
|
+
xp_libs_analytics/skills/generic-analytics/examples/README.md,sha256=vrwhlytOqCxnK--piQqirYdpHNQBWyBG2NEQkrglzpg,4658
|
|
30
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/01_count_all.yaml,sha256=O9JP_O1yr9sbuexUYrI0Bzn3Z0L578r_RfxwtV6YnP8,220
|
|
31
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/02_filter_and_count.yaml,sha256=24m8H67aBaJeePPWvwRpaS96S2NXIYpTmSR731RXeWc,348
|
|
32
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/03_group_stats_and_topk.yaml,sha256=3nWICA3EMnbsw6ajaj9sXcJ6sFpRRY1_18S3B4JhCq8,411
|
|
33
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/04_nested_or_predicates.yaml,sha256=EGi2lE_RrzL2LH0ae3H1UwFuDQmIIsvoTff8ge6EmWs,371
|
|
34
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/05_is_missing.yaml,sha256=2qpNHrnQlaThgCNNXBm9XHkuqX9LH0rRD6fZBWfDWYQ,291
|
|
35
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/06_missing_vs_null.yaml,sha256=EzCXZ0klIhoWnmnUHWLnuGG9vUHiAD1-qsm3beh5500,417
|
|
36
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/07_conditional_aggregation.yaml,sha256=YPDTIvisI_c9xLx9KFf-_Vl5CI2mj7GZtLJVcambo24,409
|
|
37
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/08_ratio_if.yaml,sha256=jbrKWMgam8jsk30t-JBIdSPApWhmb2KWE1cJlh8fgAU,376
|
|
38
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/09_tumbling_window.yaml,sha256=hJl5WxjHRqkj4_CQINW8SpQzSAZznGStSJOTvlAccJM,504
|
|
39
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/10_sliding_window.yaml,sha256=RHsWw2eoEfivWV-qYudK7u-8RheVhPwVmwaK80YTXE0,607
|
|
40
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/11_explicit_cast.yaml,sha256=2eRMJGXYvt0FoGmhVYmrfxgVfh1Ko2XVbSizFyL7RJg,358
|
|
41
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/12_text_range_distinct.yaml,sha256=Or187MwgKqi-6FkeXQRAcblwXCyBxZxbQX12Y7nokHE,474
|
|
42
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/13_summary_statistics.yaml,sha256=C9gE7kS4QXK0OqKDLwKFORK9OYkqXK2rEopiiBRIFkk,316
|
|
43
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/14_nested_and_not.yaml,sha256=ZBurCpV9IsysTH7ppCiAQ_OrbNS0rikTZSyZdsto4mk,394
|
|
44
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/15_conditional_sum.yaml,sha256=Sdss_h36Cxo7q56Eufel2b6pa54Co6dcq6yNTu-0z4s,324
|
|
45
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/16_mixed_types_cast.yaml,sha256=_sNTPDT3IsiRC89D-KnAo1Dr2Bzx0hsOXK4nE1NVhJ0,334
|
|
46
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/17_relative_last_hour.yaml,sha256=3v-dyTUbRSkpx5O2bdaVV-kCy4eY5DNq-bwjrdwxeJg,343
|
|
47
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/18_string_exact.yaml,sha256=M3K7VZqXEf1IGSN7-AOu5FRE3m8Hss-i0qFw-l2UjrE,201
|
|
48
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/19_string_normalization.yaml,sha256=ELFWXBQPWq4ngaVUtmMALXrCmImpq1hovZHoezTsCZA,296
|
|
49
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/20_prefix_suffix.yaml,sha256=fGpcrhCNRsz9-aoWvccWWccQEbLXcZDGgOHVh3EtVqE,305
|
|
50
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/21_whole_word.yaml,sha256=0av7n4XyBM7RhwhcSgtST4nMsqC6YbfnkhUU8fb4uho,265
|
|
51
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/22_ilike.yaml,sha256=eZIQ8r6jDb6IVyQXr5sMybRVLLHrsMO1EJozW4yreu4,221
|
|
52
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/23_rust_regex.yaml,sha256=hBwam504E8X7rKX6rm_TY0L0Hpt0w4gyWhPYU8ryc6A,246
|
|
53
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/24_fuzzy.yaml,sha256=khnkxnQQwZ0L4Vva-Dp1ML5uJr01tOKIrDr6wWNjNWY,326
|
|
54
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/25_multi_field_matching.yaml,sha256=Tgv5r02mbw9f-0irvt37HyrzjSuWCGggy1KzISMNIvE,446
|
|
55
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/26_conditional_fuzzy.yaml,sha256=vHCeDy8-haxURFwiLwcI6jJ_RMLKhP3lqreVnG1ShoA,421
|
|
56
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/27_temporal_fuzzy.yaml,sha256=HnTcbxq9iZGTHmdKjgRTNFj1nc5PSqetP5ZSR4sUx_A,693
|
|
57
|
+
xp_libs_analytics/skills/generic-analytics/examples/queries/28_safe_matching_diagnostics.yaml,sha256=NxMCl1v-Rz9SbLC4VLGEYyOikXobtiU7BRLctcPRTUI,440
|
|
58
|
+
xp_libs_analytics/skills/generic-analytics/references/query-language-full.md,sha256=pSyMibuBUR-S5FY2DRLWUd13QSPfIuLiNIogHxDk2LA,22287
|
|
59
|
+
xp_libs_analytics/skills/generic-analytics/references/string-matching-full.md,sha256=qaxIUrKlBKbchDS8lI7YLJGkIzJlyM4mSPyxUCDzpLo,12811
|
|
60
|
+
xp_libs_analytics-0.4.0.dist-info/METADATA,sha256=NgcWmtCXF2cuQrdNmN0ctwekahXL4-e5XZ0fSweNIkg,13395
|
|
61
|
+
xp_libs_analytics-0.4.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
62
|
+
xp_libs_analytics-0.4.0.dist-info/entry_points.txt,sha256=t1NJhAB_E1pFcV3HCXqZrtQNG_6Id3ZwdHrvcfMiyTU,72
|
|
63
|
+
xp_libs_analytics-0.4.0.dist-info/licenses/LICENSE,sha256=TdiAjt4PlXX2xjV5FO9b3b4UTx8BbkCQUfdDgJ1h15k,1130
|
|
64
|
+
xp_libs_analytics-0.4.0.dist-info/licenses/THIRD_PARTY_NOTICES.md,sha256=_ZxeuSROdZqdZu39bqjMT_eNnZwnanAsFMUCGVpvtm8,7129
|
|
65
|
+
xp_libs_analytics-0.4.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rodrigo Alves
|
|
4
|
+
Copyright (c) 2026 Generic In-Memory Analytics contributors
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
Original project code and documentation are MIT licensed (see LICENSE). Dependencies retain their own licenses. This inventory covers the complete local development/MCP environment, including optional and test tools; a core-only install has fewer dependencies. License values below are installed distribution metadata, not legal conclusions. Dependency license texts remain in the distributions' `.dist-info/licenses` or upstream source distributions. Vendored code is not copied into this product.
|
|
4
|
+
|
|
5
|
+
Polars, Pydantic and RapidFuzz use MIT; PyYAML uses MIT; FastMCP uses Apache-2.0. Preserve the relevant license and NOTICE files if redistributing those dependencies. RapidFuzz attribution: Max Bachmann and Adam Cohen; its full MIT license remains in the dependency distribution. The CycloneDX BOM and version inventory are under docs/evidence.
|
|
6
|
+
|
|
7
|
+
| Distribution | Version | License metadata |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| agent-client-protocol | 0.12.1 | Unspecified in metadata |
|
|
10
|
+
| aiobotocore | 3.10.0 | Apache-2.0 |
|
|
11
|
+
| aiofile | 3.12.3 | Apache-2.0 |
|
|
12
|
+
| aiohappyeyeballs | 2.7.1 | Python Software Foundation License |
|
|
13
|
+
| aiohttp | 3.14.5 | Apache-2.0 AND MIT |
|
|
14
|
+
| aioitertools | 0.13.0 | MIT |
|
|
15
|
+
| aiosignal | 1.4.0 | Apache Software License |
|
|
16
|
+
| annotated-doc | 0.0.5 | MIT |
|
|
17
|
+
| annotated-types | 0.8.0 | MIT |
|
|
18
|
+
| anyio | 4.16.0 | MIT |
|
|
19
|
+
| ast_serialize | 0.13.1 | MIT |
|
|
20
|
+
| attrs | 26.1.0 | MIT |
|
|
21
|
+
| Authlib | 1.9.5 | BSD License |
|
|
22
|
+
| beartype | 0.23.1 | MIT |
|
|
23
|
+
| beautifulsoup4 | 4.15.0 | MIT License |
|
|
24
|
+
| boolean.py | 5.0 | BSD-2-Clause |
|
|
25
|
+
| boto3 | 1.43.117 | Apache-2.0 |
|
|
26
|
+
| botocore | 1.43.117 | Apache-2.0 |
|
|
27
|
+
| build | 1.6.1 | MIT |
|
|
28
|
+
| CacheControl | 0.14.4 | Apache-2.0 |
|
|
29
|
+
| cachetools | 7.3.0 | MIT |
|
|
30
|
+
| caio | 0.12.10 | Apache-2.0 |
|
|
31
|
+
| certifi | 2026.10.23 | Mozilla Public License 2.0 (MPL 2.0) |
|
|
32
|
+
| cffi | 2.1.1 | MIT-0 |
|
|
33
|
+
| charset-normalizer | 3.5.2 | MIT |
|
|
34
|
+
| click | 8.5.0 | BSD-3-Clause |
|
|
35
|
+
| coverage | 7.17.2 | Apache-2.0 |
|
|
36
|
+
| cryptography | 50.0.2 | Apache-2.0 OR BSD-3-Clause |
|
|
37
|
+
| cyclonedx-python-lib | 11.12.0 | Apache Software License |
|
|
38
|
+
| cyclopts | 5.3.3 | Apache-2.0 |
|
|
39
|
+
| debugpy | 1.8.22 | MIT License |
|
|
40
|
+
| defusedxml | 0.7.1 | Python Software Foundation License |
|
|
41
|
+
| dnspython | 2.9.2 | ISC |
|
|
42
|
+
| docstring_parser | 0.18.0 | MIT License |
|
|
43
|
+
| docutils | 0.23 | Public Domain |
|
|
44
|
+
| email-validator | 2.3.0 | The Unlicense (Unlicense) |
|
|
45
|
+
| exceptiongroup | 1.3.1 | MIT License |
|
|
46
|
+
| fastapi | 0.162.0 | MIT |
|
|
47
|
+
| fastmcp | 4.1.6 | Apache-2.0 |
|
|
48
|
+
| fastmcp-slim | 4.1.6 | Apache-2.0 |
|
|
49
|
+
| filelock | 4.2.9 | MIT |
|
|
50
|
+
| frozenlist | 1.8.0 | Apache-2.0 |
|
|
51
|
+
| fsspec | 2026.6.0 | BSD-3-Clause |
|
|
52
|
+
| griffelib | 2.4.1 | ISC |
|
|
53
|
+
| h11 | 0.16.0 | MIT License |
|
|
54
|
+
| httpcore | 1.0.9 | BSD-3-Clause |
|
|
55
|
+
| httpcore2 | 2.16.0 | BSD-3-Clause |
|
|
56
|
+
| httpx | 0.28.1 | BSD License |
|
|
57
|
+
| httpx2 | 2.16.0 | BSD-3-Clause |
|
|
58
|
+
| hypothesis | 6.170.15 | MPL-2.0 |
|
|
59
|
+
| id | 1.6.1 | Apache Software License |
|
|
60
|
+
| idna | 3.20 | BSD-3-Clause |
|
|
61
|
+
| ijson | 3.6.0 | BSD-3-Clause AND ISC |
|
|
62
|
+
| iniconfig | 2.3.1 | MIT |
|
|
63
|
+
| inspect_ai | 0.3.287 | MIT License |
|
|
64
|
+
| jaraco.classes | 3.4.0 | MIT License |
|
|
65
|
+
| jaraco.context | 6.1.2 | MIT |
|
|
66
|
+
| jaraco.functools | 4.6.0 | MIT |
|
|
67
|
+
| jeepney | 0.9.0 | MIT |
|
|
68
|
+
| jiter | 0.19.0 | MIT |
|
|
69
|
+
| jmespath | 1.1.0 | MIT License |
|
|
70
|
+
| joserfc | 1.8.0 | BSD License |
|
|
71
|
+
| jsonlines | 4.0.0 | BSD License |
|
|
72
|
+
| jsonpatch | 1.44 | BSD-3-Clause |
|
|
73
|
+
| jsonpath-ng | 1.16.0 | Apache-2.0 |
|
|
74
|
+
| jsonpointer | 3.10 | BSD License |
|
|
75
|
+
| jsonref | 1.1.0 | MIT |
|
|
76
|
+
| jsonschema | 4.26.0 | MIT |
|
|
77
|
+
| jsonschema-path | 0.5.0 | Apache Software License |
|
|
78
|
+
| jsonschema-specifications | 2025.9.1 | MIT |
|
|
79
|
+
| keyring | 25.7.0 | MIT |
|
|
80
|
+
| librt | 0.16.0 | MIT |
|
|
81
|
+
| license-expression | 30.4.4 | Apache-2.0 |
|
|
82
|
+
| linkify-it-py | 2.2.0 | MIT License |
|
|
83
|
+
| markdown-it-py | 4.2.0 | MIT License |
|
|
84
|
+
| mcp | 2.3.0 | MIT License |
|
|
85
|
+
| mcp-types | 2.3.0 | MIT License |
|
|
86
|
+
| mdit-py-plugins | 0.6.1 | MIT License |
|
|
87
|
+
| mdurl | 0.1.2 | MIT License |
|
|
88
|
+
| mmh3 | 5.3.1 | MIT License |
|
|
89
|
+
| more-itertools | 11.2.1 | MIT |
|
|
90
|
+
| msgpack | 1.2.4 | Apache-2.0 |
|
|
91
|
+
| multidict | 7.2.1 | Apache-2.0 |
|
|
92
|
+
| mypy | 2.4.1 | MIT |
|
|
93
|
+
| mypy_extensions | 1.2.0 | MIT |
|
|
94
|
+
| nest-asyncio2 | 1.7.4 | BSD License |
|
|
95
|
+
| nh3 | 0.3.7 | MIT |
|
|
96
|
+
| numpy | 2.5.4 | BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0 |
|
|
97
|
+
| openai | 3.46.0 | Apache-2.0 |
|
|
98
|
+
| openapi-pydantic | 0.6.0 | MIT License |
|
|
99
|
+
| opentelemetry-api | 1.45.2 | Apache-2.0 |
|
|
100
|
+
| packageurl-python | 0.17.6 | MIT License |
|
|
101
|
+
| packaging | 26.3 | Apache-2.0 OR BSD-2-Clause |
|
|
102
|
+
| pathable | 0.6.0 | Apache Software License |
|
|
103
|
+
| pathlib_abc | 0.5.2 | Python Software Foundation License |
|
|
104
|
+
| pathspec | 1.1.1 | Mozilla Public License 2.0 (MPL 2.0) |
|
|
105
|
+
| pip | 26.3 | MIT |
|
|
106
|
+
| pip-requirements-parser | 32.0.1 | MIT |
|
|
107
|
+
| pip_api | 0.0.35 | Apache Software License |
|
|
108
|
+
| pip_audit | 2.10.1 | Apache Software License |
|
|
109
|
+
| platformdirs | 4.14.5 | MIT |
|
|
110
|
+
| pluggy | 1.7.0 | MIT License |
|
|
111
|
+
| polars | 2.1.0 | MIT License |
|
|
112
|
+
| polars-runtime-32 | 2.1.0 | MIT License |
|
|
113
|
+
| propcache | 0.5.4 | Apache-2.0 |
|
|
114
|
+
| psutil | 7.2.2 | BSD-3-Clause |
|
|
115
|
+
| py-key-value-aio | 0.4.6 | Apache-2.0 |
|
|
116
|
+
| py-serializable | 2.2.0 | Apache Software License |
|
|
117
|
+
| pycparser | 3.12 | BSD-3-Clause |
|
|
118
|
+
| pydantic | 2.14.3 | MIT |
|
|
119
|
+
| pydantic-settings | 2.16.2 | MIT |
|
|
120
|
+
| pydantic_core | 2.50.4 | MIT |
|
|
121
|
+
| Pygments | 2.21.0 | BSD-2-Clause |
|
|
122
|
+
| PyJWT | 2.15.1 | MIT |
|
|
123
|
+
| pyparsing | 3.3.3 | MIT |
|
|
124
|
+
| pyperclip | 1.11.0 | BSD License |
|
|
125
|
+
| pyproject_hooks | 1.3.3 | MIT |
|
|
126
|
+
| pytest | 9.2.0 | MIT |
|
|
127
|
+
| pytest-asyncio | 1.4.1.post1 | Apache-2.0 |
|
|
128
|
+
| pytest-cov | 7.1.0 | MIT |
|
|
129
|
+
| python-dateutil | 2.9.0.post0 | BSD License |
|
|
130
|
+
| python-dotenv | 1.2.4 | BSD-3-Clause |
|
|
131
|
+
| python-multipart | 0.0.33 | Apache-2.0 |
|
|
132
|
+
| PyYAML | 6.0.3 | MIT License |
|
|
133
|
+
| RapidFuzz | 3.14.6 | MIT |
|
|
134
|
+
| readme_renderer | 46.0 | Apache-2.0 |
|
|
135
|
+
| referencing | 0.37.0 | MIT |
|
|
136
|
+
| regex | 2026.9.29 | Apache-2.0 AND CNRI-Python |
|
|
137
|
+
| requests | 2.34.2 | Apache Software License |
|
|
138
|
+
| requests-toolbelt | 1.0.0 | Apache Software License |
|
|
139
|
+
| rfc3986 | 2.0.0 | Apache Software License |
|
|
140
|
+
| rich | 15.0.0 | MIT License |
|
|
141
|
+
| rich-rst | 2.2.0 | MIT |
|
|
142
|
+
| rpds-py | 2026.9.1 | MIT |
|
|
143
|
+
| ruff | 0.17.4 | MIT |
|
|
144
|
+
| s3fs | 2026.6.0 | BSD License |
|
|
145
|
+
| s3transfer | 0.19.3 | Apache Software License |
|
|
146
|
+
| SecretStorage | 3.5.0 | BSD-3-Clause |
|
|
147
|
+
| semver | 3.1.0 | BSD License |
|
|
148
|
+
| shortuuid | 1.0.13 | BSD License |
|
|
149
|
+
| six | 1.17.0 | MIT License |
|
|
150
|
+
| sniffio | 1.3.1 | MIT License |
|
|
151
|
+
| sortedcontainers | 2.4.0 | Apache Software License |
|
|
152
|
+
| soupsieve | 4.0.1 | MIT |
|
|
153
|
+
| sse-starlette | 3.6.0 | BSD-3-Clause |
|
|
154
|
+
| starlette | 1.10.0 | BSD-3-Clause |
|
|
155
|
+
| tenacity | 9.2.1 | Apache-2.0 |
|
|
156
|
+
| textual | 8.2.8 | MIT License |
|
|
157
|
+
| tiktoken | 0.14.0 | MIT License |
|
|
158
|
+
| tomli | 2.5.0 | MIT |
|
|
159
|
+
| tomli_w | 1.2.0 | MIT License |
|
|
160
|
+
| truststore | 0.10.5 | MIT |
|
|
161
|
+
| twine | 7.0.0 | Apache-2.0 |
|
|
162
|
+
| types-PyYAML | 6.0.12.20261103 | Apache-2.0 |
|
|
163
|
+
| typing-inspection | 0.4.5 | MIT |
|
|
164
|
+
| typing_extensions | 4.16.0 | PSF-2.0 |
|
|
165
|
+
| uncalled-for | 0.6.0 | MIT |
|
|
166
|
+
| universal_pathlib | 0.3.10 | MIT |
|
|
167
|
+
| urllib3 | 2.8.0 | MIT |
|
|
168
|
+
| uvicorn | 0.54.0 | BSD-3-Clause |
|
|
169
|
+
| watchfiles | 1.3.0 | MIT License |
|
|
170
|
+
| websockets | 17.4 | BSD-3-Clause |
|
|
171
|
+
| wrapt | 2.5.2 | BSD-2-Clause |
|
|
172
|
+
| yarl | 1.25.1 | Apache-2.0 |
|
|
173
|
+
| zipfile-zstd | 0.0.4 | MIT License |
|
|
174
|
+
| zipp | 4.1.2 | MIT |
|
|
175
|
+
| zstandard | 0.25.0 | BSD-3-Clause |
|