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.

Links

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matheel-0.6.1.tar.gz (318.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matheel-0.6.1-py3-none-any.whl (149.6 kB view details)

Uploaded Python 3

File details

Details for the file matheel-0.6.1.tar.gz.

File metadata

  • Download URL: matheel-0.6.1.tar.gz
  • Upload date:
  • Size: 318.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for matheel-0.6.1.tar.gz
Algorithm Hash digest
SHA256 d1f37c383f00d4a1d0240703640879afbe4687a7aa2bbc6442f8cdab3e77f87b
MD5 c5e4404faa6e62687b96f2a97fa06440
BLAKE2b-256 b318bd9090535c8fedb96a1763e16fe793dc1108514b11d1835fc66e70150cc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for matheel-0.6.1.tar.gz:

Publisher: publish.yml on FahadEbrahim/matheel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file matheel-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: matheel-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 149.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for matheel-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 14f09ed5d4e5545e2dcaa2c43fe697fe10967ae3588914d95c3844ab107fa7f3
MD5 5e188f13c143ab05c77de6ce82a2a0b8
BLAKE2b-256 35ceef9778fdd11b0c2ec45c044cee5c1b55b226f93d9b5b5ad4fcfdcd026fea

See more details on using hashes here.

Provenance

The following attestation bundles were made for matheel-0.6.1-py3-none-any.whl:

Publisher: publish.yml on FahadEbrahim/matheel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 files

0.6.0

2 files

0.5.8

2 files

0.5.7

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 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