TransFuzzy is a Python package for multilingual personal-name matching across Latin and several Indic scripts. It exposes the same matching pipeline through a CLI and a Flask API, and it supports switching between the bundled dataset and user-managed datasets.
- Accepts names in Latin, Devanagari, Telugu, Tamil, Kannada, Malayalam, Gujarati, and Gurmukhi.
- Transliterates non-Latin input before matching.
- Scores candidate names with phonetic, edit-distance, and embedding-based features.
- Returns the best matches through
transfuzzy predictor the HTTP API. - Lets you upload, activate, list, and delete datasets without modifying package files.
pip install transfuzzyuv syncPython 3.11+ is required.
TransFuzzy currently loads the sentence-transformers/all-MiniLM-L6-v2 model during module import. On a fresh machine, the first CLI, API, or test run may download model files from Hugging Face before the command can complete.
That has two practical consequences:
- The first run can be noticeably slower than later runs.
- Offline or restricted-network environments can fail before the CLI help text, API startup, or tests finish loading.
transfuzzyor
transfuzzy serve --port 3000The Flask server listens on http://localhost:3000 and opens that URL in your default browser on startup.
transfuzzy predict "Rahul"Limit results:
transfuzzy predict "Rahul" --top 5Return JSON:
transfuzzy predict "Rahul" --jsonUse a specific text dataset file directly:
transfuzzy predict "Rahul" --db .\names.txt --top 5 --jsonExamples of valid input:
Rahul
राहुल
రాహుల్
The output is transliterated back to the original script when the input was converted from a supported Indic script.
Starts the API server on port 3000 and opens the browser automatically.
Run the API server explicitly.
transfuzzy serve --port 3000Use --no-browser to skip opening the browser:
transfuzzy serve --port 3000 --no-browserFind similar names for a single input.
transfuzzy predict <name> [--top N] [--json] [--db PATH]Arguments:
<name>: required input string.--top: maximum number of matches to return. Default:10.--json: print a JSON object withsimilar_names.--db: use a dataset file path directly instead of the active managed dataset.
Manage datasets stored in the TransFuzzy home directory.
Add a dataset:
transfuzzy db add .\names.txtList managed datasets:
transfuzzy db listSet the active dataset:
transfuzzy db use names.txtDelete a managed dataset:
transfuzzy db delete names.txtRequest body:
{
"name": "Rahul"
}Success response:
{
"similar_names": ["Rahul", "Raahul", "Rahool"]
}Validation errors are returned as JSON with an error field and the appropriate HTTP status code.
Uploads a dataset file using multipart/form-data with the field name file.
Success response shape:
{
"message": "Dataset 'demo.txt' uploaded",
"dataset_name": "demo.txt",
"active_db": null
}Returns the stored managed datasets and the active dataset name.
{
"datasets": ["demo.txt"],
"active_db": "demo.txt"
}Request body:
{
"name": "demo.txt"
}Request body:
{
"name": "demo.txt"
}There are two ways to provide names:
- Pass a file path directly with
--db. - Store datasets with
transfuzzy db ...or the dataset API routes and switch the active dataset.
Managed datasets are stored under:
%USERPROFILE%\.transfuzzy\datasets
The active dataset name is stored in:
%USERPROFILE%\.transfuzzy\config.json
To override the base directory, set:
$env:TRANSFUZZY_HOME = "C:\path\to\custom-home"Each dataset should contain one name per line.
The current pipeline is:
Input name
-> transliteration to Latin when needed
-> candidate pair generation from the selected dataset
-> feature computation
- Soundex ratio
- Metaphone ratio
- Levenshtein ratio
- Jaro-Winkler similarity
- Cosine similarity
- Euclidean similarity
- Manhattan similarity
- Pearson similarity
-> trained model ranking
-> optional transliteration back to the input script
src/transfuzzy/
├── app.py Flask app and HTTP routes
├── cli.py CLI entrypoint
├── core/
│ ├── config.py package constants and paths
│ ├── db_manager.py managed dataset storage
│ └── pipeline.py top-level matching pipeline
├── datasets/
│ └── default.txt bundled dataset asset
├── db/ packaged training/runtime artifacts
├── dir/ feature generation and training scripts
├── static/ browser-side assets
├── templates/ HTML templates
└── utils/ helper and response utilities
Run the app locally:
uv run transfuzzy serveRun tests:
uv run python -m unittest discover -s tests -vRun training-related scripts:
uv run python src/transfuzzy/dir/enrich_data.py
uv run python src/transfuzzy/dir/train_model.pyMore development notes are in docs/DEVELOPMENT.md.
- Import-time model loading makes commands and tests depend on model availability.
- The package metadata says the project is a transliteration system, while the implementation is broader name matching.
- The repository contains packaged model and dataset artifacts in
src/transfuzzy/db, so development and release size are coupled to those files.
MIT. See LICENSE.