Skip to content

Commit c4793d2

Browse files
committed
Improved README.md and setup.py and added MANIFEST.in
1 parent 717a35a commit c4793d2

File tree

3 files changed

+44
-17
lines changed

3 files changed

+44
-17
lines changed

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include requirements.txt
2+
include README.md
3+
include LICENSE

README.md

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,29 @@ All you need to send requests is your own api key which you can get from nameapi
99

1010
This 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

1624
Create 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+
2135
Install 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.
4963
Creating 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()
5367
input_person = NaturalInputPersonBuilder().name(name_object).build()
5468
```
5569

@@ -68,7 +82,6 @@ name_object_2 = WesternInputPersonNameBuilder() \
6882
name_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

7487
name_object_4 = InputPersonName([NameField("petra müller", CommonNameFieldType.FULLNAME)])
@@ -80,7 +93,7 @@ Creating complex input person objects:
8093
input_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

91104
Response 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
112125
api_key = None # Set your api_key here
113126
client = 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
124137
api_key = None # Set your api_key here
125138
client = 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
137150
api_key = None # Set your api_key here
138151
client = 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+
139158
response = 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
148167
api_key = None # Set your api_key here
149168
client = 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
158177
api_key = None # Set your api_key here
159178
client = 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
170189
api_key = None # Set your api_key here
171190
client = NameApiClient(api_key)
172-
email_address="[email protected]"
191+
email_address="[email protected]"
173192
response = 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
182201
api_key = None # Set your api_key here
183202
client = NameApiClient(api_key)
184-
email_address="someaddress@gmail.com"
203+
email_address="someone@10minutemail.com"
185204
response = client.disposable_email_detector(email_address)
186205
```
187206

setup.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
from setuptools import setup, find_packages
22

3-
with open("README.md", "r") as fh:
3+
with open("README.md", "r", encoding="UTF-8") as fh:
44
long_description = fh.read()
55

6-
with open("requirements.txt", "r") as f:
6+
with open("requirements.txt", "r", encoding="UTF-8") as f:
77
requirements = [line.strip() for line in f]
88

99
setup(
1010
name='nameapi-client-python',
11-
version='1.0.0',
12-
description='Python Client for the NameAPI Web Service ',
11+
version='1.0.1',
12+
description='Python Client for the NameAPI Web Services',
1313
long_description=long_description,
1414
long_description_content_type="text/markdown",
15-
url="https://github.com/optimaize/nameapi-client-python",
15+
url="https://www.nameapi.org/",
16+
project_urls={
17+
'Source Code': 'https://github.com/optimaize/nameapi-client-python',
18+
'Bug Tracker': 'https://github.com/optimaize/nameapi-client-python/issues',
19+
},
1620
packages=find_packages(),
17-
keywords=['nameapi', 'rest nameapi', 'nameapi client', 'python nameapi', 'nameapi python client'],
21+
keywords=['nameapi', 'rest nameapi', 'nameapi client', 'name parser', 'name matcher', 'person risk detector',
22+
'name genderizer', 'email name parser', 'email parser', 'disposable email detector', 'dea detector'],
1823
test_suite='tests/tests.py',
1924
classifiers=[
2025
'Programming Language :: Python :: 3',

0 commit comments

Comments
 (0)