name_tools
This library is no longer maintained.
Consider a library like probablepeople.
A Python library for manipulating and comparing English, Western-style personal names.
Released under a BSD-style license.
Source: http://github.com/openstates/name_tools
Installation
To install from PyPI run
pip install name_tools
or
easy_install name_tools
To install from a source package run
python setup.py install
Usage
name_tools.split(name) breaks a name into 4 (possibly empty) parts, representing prefixes (‘Mr.’, ‘Dr.’, etc.), a ‘first part’ (given names, middle names, middle initials), a last name, and suffixes (‘Jr.’, ‘III’, ‘Ph.D’, etc.)
>>> import name_tools
>>> name_tools.split("President Barack Hussein Obama II")
('President', 'Barack Hussein', 'Obama', 'II')
>>> name_tools.split("Obama, President Barack H., II")
('President', 'Barack H', 'Obama', 'II')
>>> name_tools.split("Fleet Admiral William Frederick Halsey, Jr., USN")
('Fleet Admiral', 'William Frederick', 'Halsey', 'Jr., USN')
>>> name_tools.split("Dick van Dyke")
('', 'Dick', 'van Dyke', '')
name_tools.canonicalize(name) returns a name in a canonical format: ‘Prefixes First Last, Suffixes’, with extra spaces removed and words capitalized.
>>> name_tools.canonicalize(' WASHBURNE, zoe alleyne')
'Zoe Alleyne Washburne'
>>> name_tools.canonicalize('DR. simon tam')
'Dr. Simon Tam'
>>> name_tools.canonicalize(' thurston b. howell iii')
'Thurston B. Howell, III'
name_tools.match(name1, name2) provides a measure of the similarity between two name, considering factors such as differing word order (‘Bond, James’ and ‘James Bond’), use of initials (‘J. R. R. Tolkien’ and ‘John Ronald Reuel Tolkien’) and various titles and honorifics (‘Fleet Admiral William Frederick Halsey, Jr., USN’, and ‘William Frederick Halsey’).
>>> name_tools.match('Eric Schmidt', 'Eric Schmidt')
1.0
>>> name_tools.match('Bob Dole', 'Dole, Bob')
0.98
>>> name_tools.match("michaeL StepHens", "MichaEl StePhens")
0.98
>>> name_tools.match("Mr. X", "X")
0.95
>>> name_tools.match('Jeff Tweedy', 'J Tweedy')
0.9
>>> name_tools.match('Ferris Bueller', 'Bueller')
0.8
>>> name_tools.match('John Smith', 'John Johnson')
0.0
Metadata
Release files for name-tools 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| name_tools-0.1.7.tar.gz | 8.1 kB | Without provenance | Details for name_tools-0.1.7.tar.gz |
Release files / name_tools-0.1.7.tar.gz
| Download URL | name_tools-0.1.7.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c0efd8ad9d269a266f374f20414ff8461c9b0da902d27dacf0a118573257515
|
|
BLAKE2b-256 checksum How to use checksums |
3c3c4ce25c47135507175db88f69aa94b79032aa3823b6dca5b591c9a0e4d43c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.5
|
Security for name-tools 0.1.7
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.