@@ -9,15 +9,29 @@ All you need to send requests is your own api key which you can get from nameapi
99
1010This library requires at least Python 3.8.
1111
12+ ## Installation
1213
14+ You have two options to get the 'nameapi-client-python' library:
1315
14- ## Library setup
16+ ### 1. Download library from PyPI
17+
18+ <pre >
19+ pip install nameapi-client-python
20+ </pre >
21+
22+ ### 2. Download library from GitHub
1523
1624Create virtual environment and activate it:
1725
1826 python -m venv myenv
1927 myenv\Scripts\activate
2028
29+ Clone the repository
30+
31+ git clone https://github.com/optimaize/nameapi-client-python.git
32+ cd nameapi-client-python
33+
34+
2135Install the required libraries:
2236
2337 pip install -r requirements.txt
@@ -49,7 +63,7 @@ and is very convenient in accepting the data however you have it at hands.
4963Creating a simple person looks something like this:
5064
5165``` python
52- name_object = WesternInputPersonNameBuilder().fullname(" Petra Müller " ).build()
66+ name_object = WesternInputPersonNameBuilder().fullname(" John F. Kennedy " ).build()
5367input_person = NaturalInputPersonBuilder().name(name_object).build()
5468```
5569
@@ -68,7 +82,6 @@ name_object_2 = WesternInputPersonNameBuilder() \
6882name_object_3 = WesternInputPersonNameBuilder() \
6983 .name_field(NameField(" Petra" , CommonNameFieldType.GIVENNAME )) \
7084 .name_field(NameField(" Müller" , CommonNameFieldType.SURNAME )) \
71- .name_field(NameField(" Alexa" , AmericanNameFieldType.MIDDLENAME )) \
7285 .build()
7386
7487name_object_4 = InputPersonName([NameField(" petra müller" , CommonNameFieldType.FULLNAME )])
@@ -80,7 +93,7 @@ Creating complex input person objects:
8093input_person = NaturalInputPersonBuilder() \
8194 .name(name_object_1) \
8295 .gender(StoragePersonGender.MALE ) \
83- .add_email(" email@address .com" ) \
96+ .add_email(" email@example .com" ) \
8497 .add_tel_number(" +5555555" ) \
8598 .age(BirthDate(year = 1999 , month = 2 , day = 1 ))\
8699 .build()
@@ -90,7 +103,7 @@ input_person = NaturalInputPersonBuilder() \
90103
91104Response from the requests, displayed as json: https://api.nameapi.org/rest/swagger-ui/
92105
93- Access the link above to see all the return type and their json format.
106+ Access the link above to see all the return types and their json format.
94107
95108
96109## Commands
@@ -111,7 +124,7 @@ Name parsing is the process of splitting a full name into its components.
111124``` python
112125api_key = None # Set your api_key here
113126client = NameApiClient(api_key)
114- response = client.person_name_parser(input_person_1 )
127+ response = client.person_name_parser(input_person )
115128```
116129
117130
@@ -123,7 +136,7 @@ Name genderizing is the process of identifying the gender based on a person's na
123136``` python
124137api_key = None # Set your api_key here
125138client = NameApiClient(api_key)
126- response = client.person_genderizer(input_person_1 )
139+ response = client.person_genderizer(input_person )
127140```
128141
129142
@@ -136,6 +149,12 @@ This service takes 2 people as input:
136149``` python
137150api_key = None # Set your api_key here
138151client = NameApiClient(api_key)
152+
153+ name_object_1 = WesternInputPersonNameBuilder().fullname(" John F. Kennedy" ).build()
154+ input_person_1 = NaturalInputPersonBuilder().name(name_object).build()
155+ name_object_2 = WesternInputPersonNameBuilder().fullname(" Jack Kennedy" ).build()
156+ input_person_2 = NaturalInputPersonBuilder().name(name_object).build()
157+
139158response = client.person_matcher(input_person_1, input_person_2)
140159```
141160
@@ -147,7 +166,7 @@ The Name Formatter displays personal names in the desired form. This includes th
147166``` python
148167api_key = None # Set your api_key here
149168client = NameApiClient(api_key)
150- response = client.person_name_formatter(input_person_1 )
169+ response = client.person_name_formatter(input_person )
151170```
152171
153172## Risk Detector
@@ -157,7 +176,7 @@ Detects various types of possibly fake data in person records.
157176``` python
158177api_key = None # Set your api_key here
159178client = NameApiClient(api_key)
160- response = client.risk_detector(input_person_1 )
179+ response = client.risk_detector(input_person )
161180```
162181
163182
@@ -169,7 +188,7 @@ The Email Name Parser extracts names out of email addresses.
169188``` python
170189api_key = None # Set your api_key here
171190client = NameApiClient(api_key)
172- 191+ 173192response = client.email_name_parser(email_address)
174193```
175194
@@ -181,7 +200,7 @@ The DEA-Detector checks email addresses against a list of known "trash domains"
181200``` python
182201api_key = None # Set your api_key here
183202client = NameApiClient(api_key)
184- email_address= " someaddress@gmail .com"
203+ email_address= " someone@10minutemail .com"
185204response = client.disposable_email_detector(email_address)
186205```
187206
0 commit comments