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.2.tar.gz
(23.4 kB
view hashes)
Built Distribution
nominally-1.0.2-py3-none-any.whl
(32.9 kB
view hashes)
Close
Hashes for nominally-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6f31e46de0bf8c86a60fba82ea60f6ce454c15d39301d0afb568b2b906206d1 |
|
MD5 | dd6d2ca3cbebfff1c898166626368fff |
|
BLAKE2b-256 | 038a2ed744ebee091bb407eb123ee8bd4abcff3a6b2c7e25fa908ed76f39f6c4 |