A maximum-strength name parser for record linkage.
Project description
nominally: a maximum-strength name parser for record linkage
🖥️ Examples
Run a quick name at the command line:
$ nominally "Jimmy Blankinsop"
raw: Jimmy Blankinsop
cleaned: jimmy blankinsop
parsed: blankinsop, jimmy
list: ['', 'jimmy', '', 'blankinsop', '', '']
title:
first: jimmy
middle:
last: blankinsop
suffix:
nickname:
Pull out the major parts...
$ python -q
>>> from nominally import parse_name
>>> parse_name("Blankinsop, Jr., Mr. James 'Jimmy'")
{
'title': 'mr',
'first': 'james',
'middle': '',
'last': 'blankinsop',
'suffix': 'jr',
'nickname': 'jimmy'
}
Or separate into individual parts; complete string; lists; dicts...
$ python -q
>>> from nominally import Name
>>> n = Name("DR. PEACHES BARTKOWICZ")
>>> n
Name({'title': 'dr', 'first': 'peaches', 'middle': '', 'last': 'bartkowicz', 'suffix': '', 'nickname': ''})
>>> str(n)
'dr peaches bartkowicz'
>>> dict(n)
{
'title': 'dr',
'first': 'peaches',
'middle': '',
'last': 'bartkowicz',
'suffix': '',
'nickname': ''
}
>>> list(n.values())
['dr', 'peaches', '', 'bartkowicz', '', '']
>>> n.first
'peaches'
>>> n.last
'bartkowicz'
>>> n.raw
'DR. PEACHES BARTKOWICZ'
>>> n.report()
{
'raw': 'DR. PEACHES BARTKOWICZ',
'cleaned': 'dr peaches bartkowicz',
'parsed': 'bartkowicz, dr peaches',
'list': ['dr', 'peaches', '', 'bartkowicz', '', ''],
'title': 'dr',
'first': 'peaches',
'middle': '',
'last': 'bartkowicz',
'suffix': '',
'nickname': ''
}
🔬 Elaborate Examples
For fully worked examples, see: https://github.com/vaneseltine/nominally-examples/
🧙 Author
🎓 Beginnings
Nominally started as a fork of the python-nameparser package, and has benefitted considerably from this origin⸺especially the testing foundation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nominally-1.0.0.tar.gz
(25.8 kB
view hashes)
Built Distribution
nominally-1.0.0-py3-none-any.whl
(32.2 kB
view hashes)
Close
Hashes for nominally-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44585e4ad5e52313a3a61fef9c97cd045587b2295dfdb8d6af7787039c5b3514 |
|
MD5 | 3369e82fe9a3db592c90f83631ed69b5 |
|
BLAKE2b-256 | c95109f9b85ab7e2822f0cbd6ca2e44107f974f842dc3acc3445346d0bdd38ca |