A Python-based CLI tool that matches company names from an input CSV file or folder against a master CSV file or folder.
- Streamed CSV processing for low memory usage
- Fast fuzzy matching using
rapidfuzz - Support for processing a single input file or all CSV files in an input folder
- Returns up to 5 top matches with confidence scores for each input company, sorted by similarity (descending)
- Real-time progress tracking with estimated time remaining (ETA)
- Docker-ready execution to avoid polluting local Python environments
- Adds
matched_company,confidence, and up to 4 additional match columns to output CSV files
pip install -r requirements.txtPrepare an input file or folder and a master file or folder:
input/containing one or more.csvfilesmaster/containing one or more.csvfiles
Run locally:
python match_companies.py --input input --master master --output output --threshold 80If you prefer a single file:
python match_companies.py --input input/sample_input.csv --master master/master_list.csv --output output --threshold 80Build the image:
docker build -t company-matcher .Run the container:
docker run --rm -v "%cd%/input:/app/input" -v "%cd%/master:/app/master" -v "%cd%/output:/app/output" company-matcher --input input --master master --output output --threshold 80The tool generates output CSV files with the following additional columns:
matched_company- The top matching company name from the master listconfidence- Confidence score (0-100) for the top matchmatched_company_2tomatched_company_5- 2nd through 5th best matchesconfidence_2toconfidence_5- Confidence scores for matches 2-5
All matches are sorted by confidence score in descending order and only included if they meet the threshold score.
thresholdis the minimum accepted similarity score.- If the input or master path is a folder, all
.csvfiles in that folder are processed. - The output folder will be created automatically if it does not exist.