Matheel
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.
Links
- Documentation: fahadebrahim.github.io/matheel
- Choosing metrics: similarity guide
- Public plagiarism benchmark: definition and reproduction recipe, results and scope
- Hugging Face Space demo: buelfhood/matheel-framework
- Core workflows Colab notebook: Open in Colab
- Dataset workflows Colab notebook: Open in Colab
- Custom algorithms Colab notebook: Open in Colab
- Gradio Colab notebook: Open in Colab
- Visualization and leaderboard Colab notebook: Open in Colab
- Examples folder: examples/
- Development: development docs
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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| matheel-0.7.1.tar.gz | 894.0 kB | With provenance | Details for matheel-0.7.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| matheel-0.7.1-py3-none-any.whl | Python 3 | none | any | Details for matheel-0.7.1-py3-none-any.whl |
Total release size: 1.1 MB
Release files / matheel-0.7.1.tar.gz
| Download URL | matheel-0.7.1.tar.gz |
|---|---|
| Size | 894.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bab2422e90fa1f7822fedae5c1d8792fe0c4c17792f8ccb3172dbdd7949ceda2
|
|
BLAKE2b-256 checksum How to use checksums |
e127f7f8ca2c2d3d9f76bf531bc8d43f375df2cbf134de7b6a8acf80b6c8c680
|
| 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 logRelease files / matheel-0.7.1-py3-none-any.whl
| Download URL | matheel-0.7.1-py3-none-any.whl |
|---|---|
| Size | 213.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b53e215f5f95aa7198eec229a3c30127ec4f38d1a1b7ca77460b7e705ca3473f
|
|
BLAKE2b-256 checksum How to use checksums |
f25577e82f7f73c3311a2e94ca645f4f14b908469c7556ce4e9fc68e7b47115a
|
| 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 logSecurity for matheel 0.7.1
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.
Attestation for matheel-0.7.1.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 logA 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.