Skip to main content

DetectMateLibrary

Main library to run the different components in DetectMate.

Main structure

The library contains the next components:

  • Parsers: parse the logs received from the reader.
  • Detectors: return alerts if anomalies are detected.
  • Alert Aggregation: aggregate the alerts produced by the detectors.
  • Schemas: standard data classes use in DetectMate.
 +--------+     +-----------+    +-------------------+
 | Parser | --> |  Detector | -> | Alert Aggregation |
 +--------+     +-----------+    +-------------------+

Developer setup:

Step 1: Install python dependencies

Set up the dev environment and install pre-commit hooks:

uv sync --dev
uv run prek install

Step 2: Install Protobuf dependencies

To install in Linux do:

sudo apt install -y protobuf-compiler
protoc --version

This dependency is only needed if a proto file is modified. To compile the proto file do:

protoc --proto_path=src/detectmatelibrary/schemas/ --python_out=src/detectmatelibrary/schemas/ src/detectmatelibrary/schemas/schemas.proto

Step 3: Run unit tests

Run the tests:

uv run --dev pytest -q

Run the tests with coverage (add --cov-report=html to generate an HTML report):

uv run --dev pytest --cov=. --cov-report=term-missing

Workspace generator (mate create)

DetectMateLibrary includes a small CLI helper to bootstrap standalone workspaces for custom parsers and detectors. This is useful if you want to develop and test components in isolation while still using the same library and schemas.

Usage

The CLI entry point is mate with a create command:

mate create --type <parser|detector> --name <workspace_name> --dir <target_dir>
Option Description
--type Component type to generate:
- parser: CoreParser-based template
- detector: CoreDetector-based template
--name Name of the component and package:
- Creates package dir: <target_dir>/<name>/
- Creates main file: <name>.py
- Derives class names: <Name> and <Name>Config
--dir Directory where the workspace will be created

What gets generated

For example:

mate create --type parser --name custom_parser --dir ./workspaces/custom_parser

will create:

workspaces/custom_parser/          # workspace root
├── custom_parser/                 # Python package
│   ├── __init__.py
│   └── custom_parser.py           # CoreParser-based template
├── tests/
│   └── test_custom_parser.py      # generated from template to test custom_parser
├── data.json                      # example data to run the code
├── LICENSE.md                     # copied from main project
├── .gitignore                     # copied from main project
├── .pre-commit-config.yaml        # copied from main project
├── pyproject.toml                 # minimal project + dev extras
└── README.md                      # setup instructions

Documentation

Contribution

We're happily taking patches and other contributions. Please see the following links for how to get started:

If you encounter any bugs, please create an issue on Github.

License

EUPL-1.2

Release files for detectmatelibrary 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for detectmatelibrary 0.5.2
File Size Uploaded
detectmatelibrary-0.5.2.tar.gz 111.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for detectmatelibrary 0.5.2
File Interpreter ABI Platform
detectmatelibrary-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 266.4 kB

Release files / detectmatelibrary-0.5.2.tar.gz

Download URL detectmatelibrary-0.5.2.tar.gz
Size 111.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5b6b052542614c16d17e7fe3c2fdd69964a9dcc81008b3e6b3352f7152fa9f25
BLAKE2b-256 checksum
How to use checksums
f07434997ce807bd7bfe00989f0ce110f3832afac42aef23d50a37cef8d6c9c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / detectmatelibrary-0.5.2-py3-none-any.whl

Download URL detectmatelibrary-0.5.2-py3-none-any.whl
Size 154.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6349e5a9516bee6dd901df28b98d38a230c8586b872f23423d8d921e98c592b
BLAKE2b-256 checksum
How to use checksums
4424c8306ecb0130e0af87c49aa5ec98858ae7501df25a725d42a85949788257
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.4

2 release files

0.5.3

2 release files

This release

0.5.2 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page