Skip to content

Commit c911d3a

Browse files
committed
update docs, use alabaster theme
1 parent 4e5744c commit c911d3a

File tree

6 files changed

+214
-199
lines changed

6 files changed

+214
-199
lines changed

README.rst

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,43 @@ Name Parser
77
:target: http://badge.fury.io/py/nameparser
88

99
A simple Python (3.2+ & 2.6+) module for parsing human names into their
10-
individual components. Pass the HumanName class a string containing a full name.
11-
The name is split on spaces and then parsed into name parts based on placement
12-
in the string and matches against known name pieces like titles. Access the name
13-
via instance attributes.
10+
individual components.
11+
12+
* hn.title
13+
* hn.first
14+
* hn.middle
15+
* hn.last
16+
* hn.suffix
17+
* hn.nickname
18+
19+
Supports 3 different comma placement variations in the input string.
20+
21+
1. Title Firstname "Nickname" Middle Middle Lastname Suffix
22+
2. Lastname [Suffix], Title Firstname (Nickname) Middle Middle[,] Suffix [, Suffix]
23+
3. Title Firstname M Lastname [Suffix], Suffix [Suffix] [, Suffix]
24+
25+
Instantiating the `HumanName` class with a string splits on commas and then spaces,
26+
classifying name parts based on placement in the string and matches against known name
27+
pieces like titles and suffixes.
1428

1529
It correctly handles some common conjunctions and special prefixes to last names
16-
like "del". Titles can be chained together and include conjunctions to handle
30+
like "del". Titles and conjunctions can be chained together to handle complex
1731
titles like "Asst Secretary of State". It can also try to correct capitalization
1832
of all names that are all upper- or lowercase names.
1933

2034
It attempts the best guess that can be made with a simple, rule-based approach.
21-
Unicode is supported, but the parser is not likely to be useful for languages
22-
that do not have a structure similar to English names. It's not perfect, but it
35+
Its main use case is English and it is not likely to be useful for languages
36+
that do not share the same structure as English names. It's not perfect, but it
2337
gets you pretty far.
2438

39+
Installation
40+
------------
41+
42+
::
43+
44+
pip install nameparser
45+
46+
2547
Quick Start Example
2648
-------------------
2749

@@ -47,13 +69,7 @@ Quick Start Example
4769
'Juan de la Vega'
4870

4971

50-
3 different comma placement variations are supported:
51-
52-
* Title Firstname "Nickname" Middle Middle Lastname Suffix
53-
* Lastname [Suffix], Title Firstname (Nickname) Middle Middle[,] Suffix [, Suffix]
54-
* Title Firstname M Lastname [Suffix], Suffix [Suffix] [, Suffix]
55-
56-
The parser does not make any attempt to clean the input. It mostly just splits on white
72+
The parser does not attempt to correct mistakes in the input. It mostly just splits on white
5773
space and puts things in buckets based on their position in the string. This also means
5874
the difference between 'title' and 'suffix' is positional, not semantic. "Dr" is a title
5975
when it comes before the name and a suffix when it comes after. ("Pre-nominal"

docs/conf.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,27 @@
104104

105105
# The theme to use for HTML and HTML Help pages. See the documentation for
106106
# a list of builtin themes.
107-
html_theme = 'default'
107+
html_theme = 'alabaster'
108+
109+
import alabaster
110+
111+
html_theme_path = [alabaster.get_path()]
112+
extensions += ['alabaster']
113+
html_theme = 'alabaster'
114+
html_sidebars = {
115+
'**': [
116+
'about.html',
117+
'navigation.html',
118+
'relations.html',
119+
'searchbox.html',
120+
'donate.html',
121+
]
122+
}
123+
html_theme_options = {
124+
'github_user': 'derek73',
125+
'github_repo': 'python-nameparser',
126+
'travis_button': True,
127+
}
108128

109129
# Theme options are theme-specific and customize the look and feel of a theme
110130
# further. For a list of options available for each theme, see the

0 commit comments

Comments
 (0)