skip to navigation
skip to content

Not Logged In

name-cleaver 0.4.1

Name parser and formatter (for politicians, individuals, and organizations)

Latest Version: 0.6.0

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 PolicitianNameCleaver smith = PoliticianNameCleaver('Smith, Robert J').parse()

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. In the case that 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.

 
File Type Py Version Uploaded on Size
name-cleaver-0.4.1.tar.gz (md5) Source 2012-10-31 7KB
  • Downloads (All Versions):
  • 7 downloads in the last day
  • 282 downloads in the last week
  • 1899 downloads in the last month