Skip to main content

Matheel

Tests PyPI Python versions Docs Latest release License

Matheel is a Python package and CLI for source-code similarity. It combines semantic embeddings, lexical similarity, chunking, preprocessing, and code evaluation metrics in one workflow.

Installation

Matheel supports Python 3.10 to 3.13.

Recommended install:

pip install "matheel[all]"

For a lightweight install without optional semantic, chunking, metrics, and Gradio dependencies:

pip install matheel

Installation options are covered in the usage guide.

Quick Start

Create a tiny archive and compare it with the CLI:

python - <<'PY'
from zipfile import ZipFile

with ZipFile("sample_pairs.zip", "w") as archive:
    archive.writestr("a.py", "def add(a, b):\n    return a + b\n")
    archive.writestr("b.py", "def add(x, y):\n    return x + y\n")
    archive.writestr("c.py", "def sub(a, b):\n    return a - b\n")
PY

matheel compare sample_pairs.zip \
  --feature-weight levenshtein=1.0 \
  --num 10

Or score a pair directly from Python:

from matheel.similarity import calculate_similarity

score = calculate_similarity(
    "def add(a, b):\n    return a + b\n",
    "def add(x, y):\n    return x + y\n",
    feature_weights={"levenshtein": 1.0},
)
print(round(score, 4))

See the usage guide for semantic models, archives, comparison suites, custom algorithms, chunking, preprocessing, visualization, leaderboards, and code metrics.

Development

Contributor setup, tests, linting, package checks, and release preparation are documented in the development docs.

License

This project is licensed under the MIT License.

Metadata

Release files for matheel 0.7.0

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

Source distribution (sdist)

Source distribution for matheel 0.7.0
File Size Uploaded Provenance Actions
matheel-0.7.0.tar.gz 653.3 kB With provenance Details for matheel-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 824.5 kB

Release files / matheel-0.7.0.tar.gz

Download URL matheel-0.7.0.tar.gz
Size 653.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b5292f844d2f2e420e9de20191f633174e2ac612d1cf8b1c50a8dc8b0fdc4579
BLAKE2b-256 checksum
How to use checksums
9a57e82219cc3b09f3a841624ea85379087ae29fbe9ab6f27d4491b867bd27e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Oct 20, 2026.

Transparency log

Release files / matheel-0.7.0-py3-none-any.whl

Download URL matheel-0.7.0-py3-none-any.whl
Size 171.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af823475b38ffea8a53b542eac3ffdac9b766b41db18398c8456f6f2439ea307
BLAKE2b-256 checksum
How to use checksums
524633e356ad111c85f1a755727ca2c7f2406576fad87a2dc68b497c28ea7f81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Oct 20, 2026.

Transparency log

Security for matheel 0.7.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for matheel-0.7.0.tar.gz

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 Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files Full provenance

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