Skip to main content

name_matching

Name matching

Name matching is a Python package for the matching of company names. This package has been developed to match the names of companies from different databases together to allow them to be merged. The package has a number of options to determine how exact the matches should be and also for the selection of different name matching algorithms.

For a more in-depth discussion of the name matching package please see the company name matching medium post

Installation

The package can be installed via PiPy:

pip install name_matching

Alternatively you could install the package by downloading the repo, navigating to the folder and run the setup in pip locally

pip install .

Usage

To see example usage of the package you can use the notebook folder. An example of the usage is also given below

import pandas as pd
from name_matching.name_matcher import NameMatcher

# define a dataset with bank names
df_companies_a = pd.DataFrame({'Company name': [
        'Industrial and Commercial Bank of China Limited',
        'China Construction Bank',
        'Agricultural Bank of China',
        'Bank of China',
        'JPMorgan Chase',
        'Mitsubishi UFJ Financial Group',
        'Bank of America',
        'HSBC',
        'BNP Paribas',
        'Crédit Agricole']})

# alter each of the bank names a bit to test the matching
df_companies_b = pd.DataFrame({'name': [
        'Bank of China Limited',
        'Mitsubishi Financial Group',
        'Construction Bank China',
        'Agricultural Bank',
        'Bank of Amerika',
        'BNP Parisbas',
        'JP Morgan Chase',
        'HSCB',
        'Industrial and Commercial Bank of China',
        'Credite Agricole']})

# initialise the name matcher
matcher = NameMatcher(number_of_matches=1, 
                      legal_suffixes=True, 
                      common_words=False, 
                      top_n=50, 
                      verbose=True)

# adjust the distance metrics to use
matcher.set_distance_metrics(['bag', 'typo', 'refined_soundex'])

# load the data to which the names should be matched
matcher.load_and_process_master_data(column='Company name',
                                     df_matching_data=df_companies_a, 
                                     transform=True)

# perform the name matching on the data you want matched
matches = matcher.match_names(to_be_matched=df_companies_b, 
                              column_matching='name')

# combine the datasets based on the matches
combined = pd.merge(df_companies_a, matches, how='left', left_index=True, right_on='match_index')
combined = pd.merge(combined, df_companies_b, how='left', left_index=True, right_index=True)

Contributing

All contributions are welcome. For more substantial changes, please open an issue first to discuss what you would like to change.

License

The code is licensed under the MIT/X license an extended version of the licence: MIT

Thanks

Thanks to the work of implementing name matching algorithms done in the Abydos package. These form the basis of the name matching algorithms used in this package.

Metadata

Release files for name-matching 0.9.23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for name-matching 0.9.23
File Size Uploaded Provenance Actions
name_matching-0.9.23.tar.gz 106.9 kB With provenance Details for name_matching-0.9.23.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for name-matching 0.9.23
File Interpreter ABI Platform Actions
name_matching-0.9.23-py3-none-any.whl Python 3 none any Details for name_matching-0.9.23-py3-none-any.whl

Total release size: 260.8 kB

Release files / name_matching-0.9.23.tar.gz

Download URL name_matching-0.9.23.tar.gz
Size 106.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ecfc9bffd2f70993931d0bcdbc20d320d598f75b9990d36b76b046f4b06f85af
BLAKE2b-256 checksum
How to use checksums
2c83bc5068d4391b7b98dd94e6f44213dc982982b605bdaae06e53b792e13c41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / name_matching-0.9.23-py3-none-any.whl

Download URL name_matching-0.9.23-py3-none-any.whl
Size 153.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f97e37b14687ef795bc67d0b24233062808de912fc6df82622521816e838e39
BLAKE2b-256 checksum
How to use checksums
be693ae4eba0acbde876558082d43fd3cf6258cfa3ae61396d3162430c72ea70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for name-matching 0.9.23

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for name_matching-0.9.23.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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