Temporal event-pattern matching over partitioned, timestamped event sequences, with explicit semantics and near-miss explanations.
Project description
epigrep
Temporal event-pattern matching over partitioned, timestamped event sequences — grep-like matching for "what happened, in what order, within what time" — with explicit semantics and near-miss explanations.
Give me partitioned timestamped events and a temporal pattern; I will return spans, captures, and explanations with explicit semantics.
Install
This package is not yet published to PyPI/TestPyPI. In the 0.1 RC work area, install from a local wheel built by maturin:
maturin build --release --manifest-path crates/epigrep-py/Cargo.toml --out dist
python -m pip install --no-index --find-links dist epigrep
Quick Start
from epigrep import Event, Pattern, explain, match, schema
stream = [
Event("api-0", 0, "config_reload", {"pod": "api-0"}),
Event("api-0", 30, "readiness_success", {"pod": "api-0"}),
Event("api-0", 70, "oom_killed", {"pod": "api-0"}),
Event("api-1", 0, "config_reload", {"pod": "api-1"}),
Event("api-1", 90, "oom_killed", {"pod": "api-1"}),
]
pattern = (
Pattern.event("config_reload")
.then("oom_killed", within=120, no="readiness_success")
.build()
)
for m in match(pattern, stream):
print(m.partition, list(m.indices), dict(m.captures)) # api-1 [3, 4] {}
# Why didn't the others match?
for nm in explain(pattern, stream):
print(nm.partition, nm.reason) # api-0 absence_blocked
schema(stream) summarises the event types and attributes available;
match(...) runs a pattern (compiled by default, exhaustive= and oracle=
flags available); explain(...) returns near-misses with structured detail.
Pandas dataframe helpers are available when pandas is installed; matching and
explanation do not require pandas.
Programmatic / agent use
Patterns round-trip through a stable JSON AST, the recommended interface for tools and LLMs (emit/validate a structured pattern rather than DSL text):
from epigrep import Pattern, pattern_from_json
ast = Pattern.event("A").then("B", within=5).build().to_json()
pattern = pattern_from_json(ast) # validated; safe to match
parse_pattern(...) remains importable for demos and experiments, but the text
DSL is provisional and outside the 0.1 stability guarantee.
Semantics
Matching has an explicit, tested contract (ordering and tie-breaking, partitioning, match-consumption modes, inclusive windows, absence-between, capture/register equality, overlapping matches, and near-miss guarantees). A naive oracle matcher is the source of truth; a compiled matcher is checked against it by property tests.
Status
Alpha (0.1). The Python API and JSON AST are the intended stable surface; the text DSL is experimental. MIT licensed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file epigrep-0.1.0rc1.tar.gz.
File metadata
- Download URL: epigrep-0.1.0rc1.tar.gz
- Upload date:
- Size: 44.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55a173f5718bf7c8f2975a5a6d0bb16afcb6ec3186e82c5e9792cc4c0c8ba6fc
|
|
| MD5 |
6bdc1e1f9a084c3e51cea28c86e23887
|
|
| BLAKE2b-256 |
343fa67697cb7a810dff3ae98e2eaa7843d1cb201c0b7b0358d9642d674ddf6f
|
Provenance
The following attestation bundles were made for epigrep-0.1.0rc1.tar.gz:
Publisher:
release.yml on rikkhill/epigrep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epigrep-0.1.0rc1.tar.gz -
Subject digest:
55a173f5718bf7c8f2975a5a6d0bb16afcb6ec3186e82c5e9792cc4c0c8ba6fc - Sigstore transparency entry: 1853677242
- Sigstore integration time:
-
Permalink:
rikkhill/epigrep@ceb7722132965331e72c143940ed60df00761f21 -
Branch / Tag:
refs/tags/v0.1.0rc1 - Owner: https://github.com/rikkhill
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ceb7722132965331e72c143940ed60df00761f21 -
Trigger Event:
push
-
Statement type:
File details
Details for the file epigrep-0.1.0rc1-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: epigrep-0.1.0rc1-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 311.5 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
415a20cae706fc56a15204337f3e4b385ad475effecd766f4533cf1f55fd8156
|
|
| MD5 |
b8d066feb59bc42a1de937e5cd76c5e4
|
|
| BLAKE2b-256 |
94c649e0ce2e82825fc91364fb3e3059528de94a13a85af41a7e479d78e5e67b
|
Provenance
The following attestation bundles were made for epigrep-0.1.0rc1-cp39-abi3-win_amd64.whl:
Publisher:
release.yml on rikkhill/epigrep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epigrep-0.1.0rc1-cp39-abi3-win_amd64.whl -
Subject digest:
415a20cae706fc56a15204337f3e4b385ad475effecd766f4533cf1f55fd8156 - Sigstore transparency entry: 1853677535
- Sigstore integration time:
-
Permalink:
rikkhill/epigrep@ceb7722132965331e72c143940ed60df00761f21 -
Branch / Tag:
refs/tags/v0.1.0rc1 - Owner: https://github.com/rikkhill
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ceb7722132965331e72c143940ed60df00761f21 -
Trigger Event:
push
-
Statement type:
File details
Details for the file epigrep-0.1.0rc1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: epigrep-0.1.0rc1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 470.7 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc39609fb0e896ac1fbf82d9778076faa5821bfb97809a8e09e806595eff55a5
|
|
| MD5 |
c8ad31999b2fd909a1c26c151138d844
|
|
| BLAKE2b-256 |
5138f390c7afb19d1a6a5606d1b8e47219e80733f81bc6ad31c8ea1e5bc5cb83
|
Provenance
The following attestation bundles were made for epigrep-0.1.0rc1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on rikkhill/epigrep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epigrep-0.1.0rc1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
fc39609fb0e896ac1fbf82d9778076faa5821bfb97809a8e09e806595eff55a5 - Sigstore transparency entry: 1853677421
- Sigstore integration time:
-
Permalink:
rikkhill/epigrep@ceb7722132965331e72c143940ed60df00761f21 -
Branch / Tag:
refs/tags/v0.1.0rc1 - Owner: https://github.com/rikkhill
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ceb7722132965331e72c143940ed60df00761f21 -
Trigger Event:
push
-
Statement type:
File details
Details for the file epigrep-0.1.0rc1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: epigrep-0.1.0rc1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 464.8 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
023e5a1b1b2278b4d9e8717aeac35479b4d55a4acefae47f29047371ea4a73a5
|
|
| MD5 |
ac9bafcb6c44230c65a49c50401510d0
|
|
| BLAKE2b-256 |
ca1d4d0d364e61b3842a8cf264902539a997bb706c3ba8ac8ac55f8816137d3f
|
Provenance
The following attestation bundles were made for epigrep-0.1.0rc1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on rikkhill/epigrep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epigrep-0.1.0rc1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
023e5a1b1b2278b4d9e8717aeac35479b4d55a4acefae47f29047371ea4a73a5 - Sigstore transparency entry: 1853677322
- Sigstore integration time:
-
Permalink:
rikkhill/epigrep@ceb7722132965331e72c143940ed60df00761f21 -
Branch / Tag:
refs/tags/v0.1.0rc1 - Owner: https://github.com/rikkhill
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ceb7722132965331e72c143940ed60df00761f21 -
Trigger Event:
push
-
Statement type:
File details
Details for the file epigrep-0.1.0rc1-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: epigrep-0.1.0rc1-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 412.3 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c9d8eb06b3c8c77aaf2c7edfc2536157ad4328c1c1a7343f1fe18fc42369636
|
|
| MD5 |
7d32f7cde87ae86c55b009637a1e4495
|
|
| BLAKE2b-256 |
9c536859cb6c0d5b6cad5da6ae219741781a1096e89473f2554d4e5aef3ba4b1
|
Provenance
The following attestation bundles were made for epigrep-0.1.0rc1-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on rikkhill/epigrep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epigrep-0.1.0rc1-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
1c9d8eb06b3c8c77aaf2c7edfc2536157ad4328c1c1a7343f1fe18fc42369636 - Sigstore transparency entry: 1853677661
- Sigstore integration time:
-
Permalink:
rikkhill/epigrep@ceb7722132965331e72c143940ed60df00761f21 -
Branch / Tag:
refs/tags/v0.1.0rc1 - Owner: https://github.com/rikkhill
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ceb7722132965331e72c143940ed60df00761f21 -
Trigger Event:
push
-
Statement type: