Metadata-Version: 2.4
Name: matheel
Version: 0.5.5
Summary: Matheel: A CLI and Python package for source-code similarity detection.
Author: Fahad Ebrahim
License-Expression: MIT
Project-URL: Homepage, https://github.com/FahadEbrahim/matheel
Project-URL: Source, https://github.com/FahadEbrahim/matheel
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: <3.14,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click<9,>=8
Requires-Dist: pandas<3.1,>=2.2
Requires-Dist: numpy<3,>=2
Requires-Dist: rapidfuzz<4,>=3
Requires-Dist: networkx<4,>=3
Requires-Dist: tqdm<5,>=4
Requires-Dist: tree-sitter-language-pack<0.8,>=0.7
Requires-Dist: func-timeout<5,>=4
Provides-Extra: chunking
Requires-Dist: chonkie<1.7,>=1.5; extra == "chunking"
Provides-Extra: chunking-code
Requires-Dist: chonkie[code]<1.7,>=1.5; extra == "chunking-code"
Provides-Extra: metrics
Requires-Dist: apted<2,>=1.0; extra == "metrics"
Requires-Dist: bert-score<0.4,>=0.3; extra == "metrics"
Provides-Extra: sentence-transformers
Requires-Dist: sentence-transformers<5.2,>=5.1; extra == "sentence-transformers"
Requires-Dist: sentencepiece<0.3,>=0.2; extra == "sentence-transformers"
Provides-Extra: model2vec
Requires-Dist: model2vec<0.9,>=0.7; extra == "model2vec"
Provides-Extra: pylate
Requires-Dist: sentence-transformers<5.2,>=5.1; extra == "pylate"
Requires-Dist: sentencepiece<0.3,>=0.2; extra == "pylate"
Requires-Dist: pylate<1.5,>=1.4; extra == "pylate"
Provides-Extra: semantic
Requires-Dist: sentence-transformers<5.2,>=5.1; extra == "semantic"
Requires-Dist: sentencepiece<0.3,>=0.2; extra == "semantic"
Requires-Dist: model2vec<0.9,>=0.7; extra == "semantic"
Requires-Dist: pylate<1.5,>=1.4; extra == "semantic"
Provides-Extra: gradio
Requires-Dist: sentence-transformers<5.2,>=5.1; extra == "gradio"
Requires-Dist: sentencepiece<0.3,>=0.2; extra == "gradio"
Requires-Dist: gradio<6,>=5; extra == "gradio"
Requires-Dist: gradio-huggingfacehub-search<0.1,>=0.0.8; extra == "gradio"
Provides-Extra: visualization
Requires-Dist: umap-learn<0.6,>=0.5; extra == "visualization"
Provides-Extra: all
Requires-Dist: chonkie[code]<1.7,>=1.5; extra == "all"
Requires-Dist: apted<2,>=1.0; extra == "all"
Requires-Dist: bert-score<0.4,>=0.3; extra == "all"
Requires-Dist: sentence-transformers<5.2,>=5.1; extra == "all"
Requires-Dist: sentencepiece<0.3,>=0.2; extra == "all"
Requires-Dist: model2vec<0.9,>=0.7; extra == "all"
Requires-Dist: pylate<1.5,>=1.4; extra == "all"
Requires-Dist: umap-learn<0.6,>=0.5; extra == "all"
Requires-Dist: gradio<6,>=5; extra == "all"
Requires-Dist: gradio-huggingfacehub-search<0.1,>=0.0.8; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest<10,>=8; extra == "dev"
Requires-Dist: ruff<0.16,>=0.15; extra == "dev"
Requires-Dist: build<2,>=1; extra == "dev"
Requires-Dist: twine<7,>=6; extra == "dev"
Dynamic: license-file

# Matheel

[![Tests](https://github.com/FahadEbrahim/matheel/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/FahadEbrahim/matheel/actions/workflows/tests.yml)
[![PyPI](https://img.shields.io/pypi/v/matheel.svg?cacheSeconds=3600)](https://pypi.org/project/matheel/)
[![Python versions](https://img.shields.io/pypi/pyversions/matheel.svg?cacheSeconds=3600)](https://pypi.org/project/matheel/)
[![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue.svg)](https://fahadebrahim.github.io/matheel/)
[![Latest release](https://img.shields.io/github/v/release/FahadEbrahim/matheel.svg)](https://github.com/FahadEbrahim/matheel/releases)
[![License](https://img.shields.io/github/license/FahadEbrahim/matheel.svg)](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:

```bash
pip install "matheel[all]"
```

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

```bash
pip install matheel
```

Installation options are covered in the [usage guide](https://fahadebrahim.github.io/matheel/usage/#installation).

## Quick Start

```bash
python examples/sample_data.py --output sample_pairs.zip --overwrite
matheel compare sample_pairs.zip \
  --feature-weight levenshtein=1.0 \
  --num 10
```

```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](https://fahadebrahim.github.io/matheel/usage/) for semantic models, archives, comparison suites, custom algorithms, chunking, preprocessing, visualization, leaderboards, and code metrics.

## Links

- Documentation: [fahadebrahim.github.io/matheel](https://fahadebrahim.github.io/matheel/)
- Hugging Face Space demo: [buelfhood/matheel-framework](https://huggingface.co/spaces/buelfhood/matheel-framework)
- Core workflows Colab notebook: [Open in Colab](https://colab.research.google.com/github/FahadEbrahim/matheel/blob/main/examples/notebooks/01_core_workflows.ipynb)
- Dataset workflows Colab notebook: [Open in Colab](https://colab.research.google.com/github/FahadEbrahim/matheel/blob/main/examples/notebooks/02_datasets_and_reproducibility.ipynb)
- Custom algorithms Colab notebook: [Open in Colab](https://colab.research.google.com/github/FahadEbrahim/matheel/blob/main/examples/notebooks/03_custom_algorithms.ipynb)
- Gradio Colab notebook: [Open in Colab](https://colab.research.google.com/github/FahadEbrahim/matheel/blob/main/examples/notebooks/04_gradio_app.ipynb)
- Visualization and leaderboard Colab notebook: [Open in Colab](https://colab.research.google.com/github/FahadEbrahim/matheel/blob/main/examples/notebooks/05_visualization_and_leaderboard.ipynb)
- Examples folder: [examples/](https://github.com/FahadEbrahim/matheel/tree/main/examples)
- Development: [development docs](https://fahadebrahim.github.io/matheel/development/)

## Development

Contributor setup, tests, linting, package checks, and release preparation are documented in the [development docs](https://fahadebrahim.github.io/matheel/development/).

## License

This project is licensed under the [MIT License](LICENSE).
