This is the name parser and standardizer for the datacommons project. It now supports politician, individual and organization names.
Installation
Installation is easy:
pip install name-cleaver
Usage
Basic usage is the same for each type of name, just import the relevant NameCleaver class from one of:
PoliticianNameCleaver
IndividualNameCleaver
OrganizationNameCleaver
Example:
from name_cleaver import PoliticianNameCleaver smith = PoliticianNameCleaver(‘Smith, Robert J’).parse()
smith.first => “Robert” smith.middle => “J.” smith.last => “Smith”
print str(smith) => “Robert J. Smith”
Usage as above can usually be expected to return a Name object, but is not guaranteed to not throw an exception if NameCleaver is given unexpected input or otherwise can’t figure out what to do with a name. You can look for and handle Name Cleaver’s UnparseableNameException class. If you don’t want to deal with handling exceptions, NameCleaver has a safe mode:
smith = PoliticianNameCleaver(‘Smith, Robert J’).parse(safe=True)
In safe mode, if NameCleaver encounters an exception or doesn’t come up with a fully-formed name, it will return the original input string.
Metadata
Release files for name-cleaver 0.6.0
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-cleaver-0.6.0.tar.gz | 14.0 kB | Without provenance | Details for name-cleaver-0.6.0.tar.gz |
Release files / name-cleaver-0.6.0.tar.gz
| Download URL | name-cleaver-0.6.0.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0212224404a3ea26b88e599f6ec4ea7181042974c5ab77d1f125158cd49c98c2
|
|
BLAKE2b-256 checksum How to use checksums |
d4dfa7f37bb5d3ca0ed00eb95899a01303cbf6f6bdf67ea828397d0dd1670030
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for name-cleaver 0.6.0
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.