@@ -6,7 +6,7 @@ Name Parser
66.. image :: https://badge.fury.io/py/nameparser.svg
77 :target: http://badge.fury.io/py/nameparser
88
9- A simple Python module for parsing human names into their individual
9+ A simple Python (3.2+ & 2.6+) module for parsing human names into their individual
1010components. The HumanName class splits a name string up into name parts
1111based on placement in the string and matches against known name pieces
1212like titles. It joins name pieces on conjunctions and special prefixes to
@@ -19,7 +19,8 @@ Unicode is supported, but the parser is not likely to be useful for languages
1919that to not share the same structure as English names. It's not perfect, but it
2020gets you pretty far.
2121
22- **Quick Start Example **
22+ Quick Start Example
23+ -------------------
2324
2425::
2526
@@ -35,9 +36,12 @@ gets you pretty far.
3536 nickname: 'Doc Vega'
3637 ]>
3738 >>> name.last
38- u 'de la Vega'
39+ 'de la Vega'
3940 >>> name.as_dict()
40- {u'last': u'de la Vega', u'suffix': u'III', u'title': u'Dr.', u'middle': u'Q. Xavier', u'nickname': u'Doc Vega', u'first': u'Juan'}
41+ {'last': 'de la Vega', 'suffix': 'III', 'title': 'Dr.', 'middle': 'Q. Xavier', 'nickname': 'Doc Vega', 'first': 'Juan'}
42+ >>> name.string_format = "{first} {last}"
43+ >>> str(name)
44+ 'Juan de la Vega'
4145
4246
43473 different comma placement variations are supported for the string that you pass.
@@ -46,9 +50,10 @@ gets you pretty far.
4650* Lastname [Suffix], Title Firstname (Nickname) Middle Middle[,] Suffix [, Suffix]
4751* Title Firstname M Lastname [Suffix], Suffix [Suffix] [, Suffix]
4852
49- The parser does not make any attempt to clean the data that you provide. It mostly just puts
50- things in buckets based on their position between the white spaces in the string. This also means
51- the difference between 'title' and 'suffix' is positional, not semantic.
53+ The parser does not make any attempt to clean the data. It mostly just splits on white
54+ space and puts things in buckets based on their position in the string. This also means
55+ the difference between 'title' and 'suffix' is positional, not semantic. ("Pre-nominal"
56+ and "post-nominal" would probably be better names.)
5257
5358::
5459
@@ -63,19 +68,19 @@ the difference between 'title' and 'suffix' is positional, not semantic.
6368 nickname: ''
6469 ]>
6570
71+ Customization
72+ -------------
73+
6674Your project may need a bit of adjustments for your dataset. You can
6775do this in your own pre- or post-processing, by `customizing the configured pre-defined
6876sets `_ of titles, prefixes, etc., or by subclassing the `HumanName ` class. See the
6977`full documentation `_ for more information.
7078
71- .. _customizing the configured pre-defined sets : http://nameparser.readthedocs.org/en/latest/customize.html
72- .. _full documentation : http://nameparser.readthedocs.org/en/latest/
73-
74- Documentation
75- -------------
7679
7780`Full documentation `_
81+ ~~~~~~~~~~~~~~~~~~~~~
7882
83+ .. _customizing the configured pre-defined sets : http://nameparser.readthedocs.org/en/latest/customize.html
7984.. _Full documentation : http://nameparser.readthedocs.org/en/latest/
8085
8186
0 commit comments