Skip to main content

Mesi

Lint and Test codecov PyPI PyPI - Downloads License


Mesi is a tool to measure the similarity in a many-to-many fashion of long-form documents like Python source code or technical writing. The output can be useful in determining which of a collection of files are the most similar to each other.

Installation

Python 3.9+ and pipx are recommended, although Python 3.6+ and/or pip will also work.

pipx install mesi

If you'd like to test out Mesi before installing it, use the remote execution feature of pipx, which will temporarily download Mesi and run it in an isolated virtual environment.

pipx run mesi --help

Usage

For a directory structure that looks like:

projects
├── project-one
│   ├── pyproject.toml
│   ├── deliverables
│   │   └── python_program.py
│   └── README.md
├── project-two
│   ├── pyproject.toml
│   ├── deliverables
│   │   └── python_program.py
│   └── README.md
│

where similarity should be measured between each project's deliverables/python_program.py file, run the command:

mesi projects/*/deliverables/python_program.py

A lower distance in the produced table equates to a higher degree of similarity.

See the help menu (mesi --help) for additional options and configuration.

Algorithms

There are many algorithms to choose from when comparing string similarity! Mesi implements all the algorithms provided by TextDistance. In general levenshtein is never a bad choice, which is why it is the default.

Table Formats

Mesi uses tabulate for table formatting. The table format can be configured with the --table-format option to one of the formats listed in tabulate's documentation.

Dependencies

Mesi uses two primary dependencies for text similarity calculation: polyleven, and TextDistance. Polyleven is the default, as its singular implementation of Levenshtein distance can be faster in most situations. However, if a different edit distance algorithm is requested, TextDistance's implementations will be used.

Bugs/Requests

Please use the GitHub issue tracker to submit bugs or request new features, options, or algorithms.

License

Distributed under the terms of the GPL v3 license, mesi is free and open source software.

Metadata

Release files for mesi 1.1.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 mesi 1.1.0
File Size Uploaded
mesi-1.1.0.tar.gz 21.1 kB Details

Built distribution (wheel)

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

Total release size: 42.3 kB

Release files / mesi-1.1.0.tar.gz

Download URL mesi-1.1.0.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
82d90b7ad224d46c8ec94f1882446fcd2088ef10f9f9ec2861f2a34f526e6fe3
BLAKE2b-256 checksum
How to use checksums
a420d29f2bee542c3f765f5c36cc7ba5bbb12918c1e4a7bb8e6adeda4dc2e516
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.0a2 CPython/3.9.9 Linux/5.11.0-1021-azure

Release files / mesi-1.1.0-py3-none-any.whl

Download URL mesi-1.1.0-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5bbf63b0da3a224b6eebfe97b10869e474c9ad6166bba17c8d4d7815f2c7cd2
BLAKE2b-256 checksum
How to use checksums
430f249784db7d71ed4c8a9b334663e7875490f923acad4882820309587a97af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.0a2 CPython/3.9.9 Linux/5.11.0-1021-azure

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

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