apiverve-countydatalookup 1.0.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- apiverve_countydatalookup-1.0.11/LICENSE +21 -0
- apiverve_countydatalookup-1.0.11/PKG-INFO +279 -0
- apiverve_countydatalookup-1.0.11/README.md +238 -0
- apiverve_countydatalookup-1.0.11/pyproject.toml +45 -0
- apiverve_countydatalookup-1.0.11/setup.cfg +4 -0
- apiverve_countydatalookup-1.0.11/src/apiverve_countydatalookup/__init__.py +1 -0
- apiverve_countydatalookup-1.0.11/src/apiverve_countydatalookup/apiClient.py +38 -0
- apiverve_countydatalookup-1.0.11/src/apiverve_countydatalookup/exceptions.py +3 -0
- apiverve_countydatalookup-1.0.11/src/apiverve_countydatalookup/setup.py +21 -0
- apiverve_countydatalookup-1.0.11/src/apiverve_countydatalookup/tests/__init__.py +1 -0
- apiverve_countydatalookup-1.0.11/src/apiverve_countydatalookup/tests/test_api.py +19 -0
- apiverve_countydatalookup-1.0.11/src/apiverve_countydatalookup.egg-info/PKG-INFO +279 -0
- apiverve_countydatalookup-1.0.11/src/apiverve_countydatalookup.egg-info/SOURCES.txt +14 -0
- apiverve_countydatalookup-1.0.11/src/apiverve_countydatalookup.egg-info/dependency_links.txt +1 -0
- apiverve_countydatalookup-1.0.11/src/apiverve_countydatalookup.egg-info/top_level.txt +1 -0
- apiverve_countydatalookup-1.0.11/tests/test_api.py +27 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 APIVerve, and Evlar LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: apiverve-countydatalookup
|
|
3
|
+
Version: 1.0.11
|
|
4
|
+
Summary: County Data is a simple tool for getting data about US counties. It returns information such as population, area, and more based on the county name provided.
|
|
5
|
+
Author-email: APIVerve <hello@apiverve.com>
|
|
6
|
+
Project-URL: Homepage, https://apiverve.com
|
|
7
|
+
Keywords: county data,county data api,county data tool,county data software,county data service
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
14
|
+
Classifier: Intended Audience :: Healthcare Industry
|
|
15
|
+
Classifier: Intended Audience :: Education
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: Intended Audience :: Information Technology
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Classifier: Topic :: Utilities
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering
|
|
21
|
+
Classifier: Topic :: Education
|
|
22
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
|
|
23
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
|
|
24
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
26
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
27
|
+
Classifier: Topic :: Internet
|
|
28
|
+
Classifier: Topic :: Communications
|
|
29
|
+
Classifier: Topic :: Office/Business
|
|
30
|
+
Classifier: Topic :: Text Processing
|
|
31
|
+
Classifier: Topic :: Security
|
|
32
|
+
Classifier: Topic :: Database
|
|
33
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
34
|
+
Classifier: Topic :: Software Development :: Pre-processors
|
|
35
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
36
|
+
Classifier: Topic :: Software Development :: Testing
|
|
37
|
+
Classifier: Natural Language :: English
|
|
38
|
+
Requires-Python: >=3.12
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
License-File: LICENSE
|
|
41
|
+
|
|
42
|
+
County Data Lookup API
|
|
43
|
+
============
|
|
44
|
+
|
|
45
|
+
County Data is a simple tool for getting data about US counties. It returns information such as population, area, and more based on the county name provided.
|
|
46
|
+
|
|
47
|
+

|
|
48
|
+

|
|
49
|
+

|
|
50
|
+
|
|
51
|
+
This is a Python API Wrapper for the [County Data Lookup API](https://apiverve.com/marketplace/api/countydata)
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
56
|
+
pip install apiverve-countydatalookup
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
|
|
62
|
+
Before using the countydata API client, you have to setup your account and obtain your API Key.
|
|
63
|
+
You can get it by signing up at [https://apiverve.com](https://apiverve.com)
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Usage
|
|
68
|
+
|
|
69
|
+
The County Data Lookup API documentation is found here: [https://docs.apiverve.com/api/countydata](https://docs.apiverve.com/api/countydata).
|
|
70
|
+
You can find parameters, example responses, and status codes documented here.
|
|
71
|
+
|
|
72
|
+
### Setup
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
# Import the client module
|
|
76
|
+
from apiverve_countydatalookup.apiClient import CountydataAPIClient
|
|
77
|
+
|
|
78
|
+
# Initialize the client with your APIVerve API key
|
|
79
|
+
api = CountydataAPIClient("[YOUR_API_KEY]")
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
### Perform Request
|
|
86
|
+
Using the API client, you can perform requests to the API.
|
|
87
|
+
|
|
88
|
+
###### Define Query
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
query = { "state": "MO", "county": "Jackson" }
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
###### Simple Request
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
# Make a request to the API
|
|
98
|
+
result = api.execute(query)
|
|
99
|
+
|
|
100
|
+
# Print the result
|
|
101
|
+
print(result)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
###### Example Response
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
{
|
|
108
|
+
"status": "ok",
|
|
109
|
+
"error": null,
|
|
110
|
+
"data": {
|
|
111
|
+
"name": "jackson county",
|
|
112
|
+
"state": "MO",
|
|
113
|
+
"age": {
|
|
114
|
+
"85+": 0.019971238003388282
|
|
115
|
+
},
|
|
116
|
+
"male": 339932,
|
|
117
|
+
"female": 363079,
|
|
118
|
+
"deaths": {
|
|
119
|
+
"suicides": 106.71428571428571,
|
|
120
|
+
"firearm suicides": 55.095238095238095,
|
|
121
|
+
"homicides": 115.42857142857143,
|
|
122
|
+
"vehicle": 93
|
|
123
|
+
},
|
|
124
|
+
"avg_income": 47054,
|
|
125
|
+
"health": {
|
|
126
|
+
"poorHealth": 20.588989742,
|
|
127
|
+
"physicallyUnhealthyDays": 4.247736361,
|
|
128
|
+
"mentallyUnhealthyDays": 4.8111015035,
|
|
129
|
+
"lowBirthweightPercent": 9.1518749808,
|
|
130
|
+
"smokersPercent": 20.957241772,
|
|
131
|
+
"obesityPercent": 31.5,
|
|
132
|
+
"foodEnvIndex": 7.5,
|
|
133
|
+
"physicallyInactivePercent": 23.2,
|
|
134
|
+
"excessiveDrinkingPercent": 18.940103365,
|
|
135
|
+
"Teen Birth Rate": 31.109351559,
|
|
136
|
+
"% Uninsured": 12.486314662,
|
|
137
|
+
"% With Annual Mammogram": 45,
|
|
138
|
+
"% Vaccinated": 51,
|
|
139
|
+
"% Children in Poverty": 19.6,
|
|
140
|
+
"80th Percentile Income": 108296,
|
|
141
|
+
"20th Percentile Income": 23275,
|
|
142
|
+
"Violent Crime Rate": 941.43198334,
|
|
143
|
+
"Average Daily PM2.5": 9.1,
|
|
144
|
+
"% Severe Housing Problems": 15.347550638,
|
|
145
|
+
"% Drive Alone to Work": 83.470246386
|
|
146
|
+
},
|
|
147
|
+
"landAreaKM2": 1565.601892,
|
|
148
|
+
"areaKM2": 1596.319707,
|
|
149
|
+
"longitude": -94.347496655033936,
|
|
150
|
+
"latitude": 39.016701918102484,
|
|
151
|
+
"zipCodes": [
|
|
152
|
+
"64137",
|
|
153
|
+
"64111",
|
|
154
|
+
"64053",
|
|
155
|
+
"64055",
|
|
156
|
+
"64064",
|
|
157
|
+
"64029",
|
|
158
|
+
"64106",
|
|
159
|
+
"64108",
|
|
160
|
+
"64034",
|
|
161
|
+
"64118",
|
|
162
|
+
"64136",
|
|
163
|
+
"64139",
|
|
164
|
+
"64125",
|
|
165
|
+
"64030",
|
|
166
|
+
"64014",
|
|
167
|
+
"64066",
|
|
168
|
+
"64080",
|
|
169
|
+
"64123",
|
|
170
|
+
"64131",
|
|
171
|
+
"64145",
|
|
172
|
+
"64128",
|
|
173
|
+
"64121",
|
|
174
|
+
"64170",
|
|
175
|
+
"64050",
|
|
176
|
+
"64057",
|
|
177
|
+
"64133",
|
|
178
|
+
"64109",
|
|
179
|
+
"64130",
|
|
180
|
+
"64134",
|
|
181
|
+
"64129",
|
|
182
|
+
"64158",
|
|
183
|
+
"64163",
|
|
184
|
+
"64070",
|
|
185
|
+
"64102",
|
|
186
|
+
"64105",
|
|
187
|
+
"64086",
|
|
188
|
+
"64101",
|
|
189
|
+
"64124",
|
|
190
|
+
"64157",
|
|
191
|
+
"64088",
|
|
192
|
+
"64061",
|
|
193
|
+
"64051",
|
|
194
|
+
"64002",
|
|
195
|
+
"64081",
|
|
196
|
+
"64013",
|
|
197
|
+
"64016",
|
|
198
|
+
"64112",
|
|
199
|
+
"64114",
|
|
200
|
+
"64110",
|
|
201
|
+
"64152",
|
|
202
|
+
"64127",
|
|
203
|
+
"64147",
|
|
204
|
+
"64120",
|
|
205
|
+
"64146",
|
|
206
|
+
"64199",
|
|
207
|
+
"64058",
|
|
208
|
+
"64054",
|
|
209
|
+
"64074",
|
|
210
|
+
"64119",
|
|
211
|
+
"64138",
|
|
212
|
+
"64149",
|
|
213
|
+
"64156",
|
|
214
|
+
"64132",
|
|
215
|
+
"64171",
|
|
216
|
+
"64148",
|
|
217
|
+
"64141",
|
|
218
|
+
"64999",
|
|
219
|
+
"64052",
|
|
220
|
+
"64015",
|
|
221
|
+
"64063",
|
|
222
|
+
"64075",
|
|
223
|
+
"64056",
|
|
224
|
+
"64082",
|
|
225
|
+
"64113",
|
|
226
|
+
"64155",
|
|
227
|
+
"64126",
|
|
228
|
+
"64197",
|
|
229
|
+
"64065",
|
|
230
|
+
"64198"
|
|
231
|
+
],
|
|
232
|
+
"lifeExpectancy": 77.19,
|
|
233
|
+
"education": {
|
|
234
|
+
"bachelors+": 31.6,
|
|
235
|
+
"lessThanHighSchool": 9.4,
|
|
236
|
+
"highSchool": 28.3,
|
|
237
|
+
"someCollege": 30.7
|
|
238
|
+
},
|
|
239
|
+
"povertyRate": 13.7,
|
|
240
|
+
"costOfLiving": {
|
|
241
|
+
"living_wage": 14.55,
|
|
242
|
+
"food_costs": 3246,
|
|
243
|
+
"medical_costs": 2681,
|
|
244
|
+
"housing_costs": 8136,
|
|
245
|
+
"tax_costs": 6263
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Customer Support
|
|
254
|
+
|
|
255
|
+
Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact).
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Updates
|
|
260
|
+
Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Legal
|
|
265
|
+
|
|
266
|
+
All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms) and all legal documents and agreements.
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## License
|
|
271
|
+
Licensed under the The MIT License (MIT)
|
|
272
|
+
|
|
273
|
+
Copyright (©) 2024 APIVerve, and Evlar LLC
|
|
274
|
+
|
|
275
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
276
|
+
|
|
277
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
278
|
+
|
|
279
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
County Data Lookup API
|
|
2
|
+
============
|
|
3
|
+
|
|
4
|
+
County Data is a simple tool for getting data about US counties. It returns information such as population, area, and more based on the county name provided.
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
This is a Python API Wrapper for the [County Data Lookup API](https://apiverve.com/marketplace/api/countydata)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
pip install apiverve-countydatalookup
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
Before using the countydata API client, you have to setup your account and obtain your API Key.
|
|
22
|
+
You can get it by signing up at [https://apiverve.com](https://apiverve.com)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
The County Data Lookup API documentation is found here: [https://docs.apiverve.com/api/countydata](https://docs.apiverve.com/api/countydata).
|
|
29
|
+
You can find parameters, example responses, and status codes documented here.
|
|
30
|
+
|
|
31
|
+
### Setup
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
# Import the client module
|
|
35
|
+
from apiverve_countydatalookup.apiClient import CountydataAPIClient
|
|
36
|
+
|
|
37
|
+
# Initialize the client with your APIVerve API key
|
|
38
|
+
api = CountydataAPIClient("[YOUR_API_KEY]")
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Perform Request
|
|
45
|
+
Using the API client, you can perform requests to the API.
|
|
46
|
+
|
|
47
|
+
###### Define Query
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
query = { "state": "MO", "county": "Jackson" }
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
###### Simple Request
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
# Make a request to the API
|
|
57
|
+
result = api.execute(query)
|
|
58
|
+
|
|
59
|
+
# Print the result
|
|
60
|
+
print(result)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
###### Example Response
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
{
|
|
67
|
+
"status": "ok",
|
|
68
|
+
"error": null,
|
|
69
|
+
"data": {
|
|
70
|
+
"name": "jackson county",
|
|
71
|
+
"state": "MO",
|
|
72
|
+
"age": {
|
|
73
|
+
"85+": 0.019971238003388282
|
|
74
|
+
},
|
|
75
|
+
"male": 339932,
|
|
76
|
+
"female": 363079,
|
|
77
|
+
"deaths": {
|
|
78
|
+
"suicides": 106.71428571428571,
|
|
79
|
+
"firearm suicides": 55.095238095238095,
|
|
80
|
+
"homicides": 115.42857142857143,
|
|
81
|
+
"vehicle": 93
|
|
82
|
+
},
|
|
83
|
+
"avg_income": 47054,
|
|
84
|
+
"health": {
|
|
85
|
+
"poorHealth": 20.588989742,
|
|
86
|
+
"physicallyUnhealthyDays": 4.247736361,
|
|
87
|
+
"mentallyUnhealthyDays": 4.8111015035,
|
|
88
|
+
"lowBirthweightPercent": 9.1518749808,
|
|
89
|
+
"smokersPercent": 20.957241772,
|
|
90
|
+
"obesityPercent": 31.5,
|
|
91
|
+
"foodEnvIndex": 7.5,
|
|
92
|
+
"physicallyInactivePercent": 23.2,
|
|
93
|
+
"excessiveDrinkingPercent": 18.940103365,
|
|
94
|
+
"Teen Birth Rate": 31.109351559,
|
|
95
|
+
"% Uninsured": 12.486314662,
|
|
96
|
+
"% With Annual Mammogram": 45,
|
|
97
|
+
"% Vaccinated": 51,
|
|
98
|
+
"% Children in Poverty": 19.6,
|
|
99
|
+
"80th Percentile Income": 108296,
|
|
100
|
+
"20th Percentile Income": 23275,
|
|
101
|
+
"Violent Crime Rate": 941.43198334,
|
|
102
|
+
"Average Daily PM2.5": 9.1,
|
|
103
|
+
"% Severe Housing Problems": 15.347550638,
|
|
104
|
+
"% Drive Alone to Work": 83.470246386
|
|
105
|
+
},
|
|
106
|
+
"landAreaKM2": 1565.601892,
|
|
107
|
+
"areaKM2": 1596.319707,
|
|
108
|
+
"longitude": -94.347496655033936,
|
|
109
|
+
"latitude": 39.016701918102484,
|
|
110
|
+
"zipCodes": [
|
|
111
|
+
"64137",
|
|
112
|
+
"64111",
|
|
113
|
+
"64053",
|
|
114
|
+
"64055",
|
|
115
|
+
"64064",
|
|
116
|
+
"64029",
|
|
117
|
+
"64106",
|
|
118
|
+
"64108",
|
|
119
|
+
"64034",
|
|
120
|
+
"64118",
|
|
121
|
+
"64136",
|
|
122
|
+
"64139",
|
|
123
|
+
"64125",
|
|
124
|
+
"64030",
|
|
125
|
+
"64014",
|
|
126
|
+
"64066",
|
|
127
|
+
"64080",
|
|
128
|
+
"64123",
|
|
129
|
+
"64131",
|
|
130
|
+
"64145",
|
|
131
|
+
"64128",
|
|
132
|
+
"64121",
|
|
133
|
+
"64170",
|
|
134
|
+
"64050",
|
|
135
|
+
"64057",
|
|
136
|
+
"64133",
|
|
137
|
+
"64109",
|
|
138
|
+
"64130",
|
|
139
|
+
"64134",
|
|
140
|
+
"64129",
|
|
141
|
+
"64158",
|
|
142
|
+
"64163",
|
|
143
|
+
"64070",
|
|
144
|
+
"64102",
|
|
145
|
+
"64105",
|
|
146
|
+
"64086",
|
|
147
|
+
"64101",
|
|
148
|
+
"64124",
|
|
149
|
+
"64157",
|
|
150
|
+
"64088",
|
|
151
|
+
"64061",
|
|
152
|
+
"64051",
|
|
153
|
+
"64002",
|
|
154
|
+
"64081",
|
|
155
|
+
"64013",
|
|
156
|
+
"64016",
|
|
157
|
+
"64112",
|
|
158
|
+
"64114",
|
|
159
|
+
"64110",
|
|
160
|
+
"64152",
|
|
161
|
+
"64127",
|
|
162
|
+
"64147",
|
|
163
|
+
"64120",
|
|
164
|
+
"64146",
|
|
165
|
+
"64199",
|
|
166
|
+
"64058",
|
|
167
|
+
"64054",
|
|
168
|
+
"64074",
|
|
169
|
+
"64119",
|
|
170
|
+
"64138",
|
|
171
|
+
"64149",
|
|
172
|
+
"64156",
|
|
173
|
+
"64132",
|
|
174
|
+
"64171",
|
|
175
|
+
"64148",
|
|
176
|
+
"64141",
|
|
177
|
+
"64999",
|
|
178
|
+
"64052",
|
|
179
|
+
"64015",
|
|
180
|
+
"64063",
|
|
181
|
+
"64075",
|
|
182
|
+
"64056",
|
|
183
|
+
"64082",
|
|
184
|
+
"64113",
|
|
185
|
+
"64155",
|
|
186
|
+
"64126",
|
|
187
|
+
"64197",
|
|
188
|
+
"64065",
|
|
189
|
+
"64198"
|
|
190
|
+
],
|
|
191
|
+
"lifeExpectancy": 77.19,
|
|
192
|
+
"education": {
|
|
193
|
+
"bachelors+": 31.6,
|
|
194
|
+
"lessThanHighSchool": 9.4,
|
|
195
|
+
"highSchool": 28.3,
|
|
196
|
+
"someCollege": 30.7
|
|
197
|
+
},
|
|
198
|
+
"povertyRate": 13.7,
|
|
199
|
+
"costOfLiving": {
|
|
200
|
+
"living_wage": 14.55,
|
|
201
|
+
"food_costs": 3246,
|
|
202
|
+
"medical_costs": 2681,
|
|
203
|
+
"housing_costs": 8136,
|
|
204
|
+
"tax_costs": 6263
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Customer Support
|
|
213
|
+
|
|
214
|
+
Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact).
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Updates
|
|
219
|
+
Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Legal
|
|
224
|
+
|
|
225
|
+
All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms) and all legal documents and agreements.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## License
|
|
230
|
+
Licensed under the The MIT License (MIT)
|
|
231
|
+
|
|
232
|
+
Copyright (©) 2024 APIVerve, and Evlar LLC
|
|
233
|
+
|
|
234
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
235
|
+
|
|
236
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
237
|
+
|
|
238
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "apiverve-countydatalookup"
|
|
3
|
+
version = "1.0.11"
|
|
4
|
+
authors = [
|
|
5
|
+
{ name="APIVerve", email="hello@apiverve.com" },
|
|
6
|
+
]
|
|
7
|
+
description = "County Data is a simple tool for getting data about US counties. It returns information such as population, area, and more based on the county name provided."
|
|
8
|
+
keywords = ["county data","county data api","county data tool","county data software","county data service"]
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.12"
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Development Status :: 5 - Production/Stable",
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"License :: OSI Approved :: MIT License",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Intended Audience :: Financial and Insurance Industry",
|
|
18
|
+
"Intended Audience :: Healthcare Industry",
|
|
19
|
+
"Intended Audience :: Education",
|
|
20
|
+
"Intended Audience :: Science/Research",
|
|
21
|
+
"Intended Audience :: Information Technology",
|
|
22
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
23
|
+
"Topic :: Utilities",
|
|
24
|
+
"Topic :: Scientific/Engineering",
|
|
25
|
+
"Topic :: Education",
|
|
26
|
+
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
|
|
27
|
+
"Topic :: Internet :: WWW/HTTP :: Site Management",
|
|
28
|
+
"Topic :: Internet :: WWW/HTTP",
|
|
29
|
+
"Topic :: Software Development :: Libraries",
|
|
30
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
31
|
+
"Topic :: Internet",
|
|
32
|
+
"Topic :: Communications",
|
|
33
|
+
"Topic :: Office/Business",
|
|
34
|
+
"Topic :: Text Processing",
|
|
35
|
+
"Topic :: Security",
|
|
36
|
+
"Topic :: Database",
|
|
37
|
+
"Topic :: Software Development :: Code Generators",
|
|
38
|
+
"Topic :: Software Development :: Pre-processors",
|
|
39
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
40
|
+
"Topic :: Software Development :: Testing",
|
|
41
|
+
"Natural Language :: English",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[project.urls]
|
|
45
|
+
Homepage = "https://apiverve.com"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .apiClient import CountydataAPIClient
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import requests
|
|
2
|
+
|
|
3
|
+
class CountydataAPIClient:
|
|
4
|
+
def __init__(self, api_key, secure=True):
|
|
5
|
+
"""
|
|
6
|
+
Initialize the CountydataAPIClient with the API key and secure flag
|
|
7
|
+
:param api_key: API key
|
|
8
|
+
:param secure: Deprecated. Always set to True
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
self.api_key = api_key
|
|
12
|
+
self.secure = secure
|
|
13
|
+
self.base_url = 'https://api.apiverve.com/v1/countydata'
|
|
14
|
+
self.headers = {
|
|
15
|
+
'x-api-key': self.api_key,
|
|
16
|
+
'auth-mode': 'pypi'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
def execute(self, params=None):
|
|
20
|
+
"""
|
|
21
|
+
Execute the API request
|
|
22
|
+
:param params: API parameters, if any
|
|
23
|
+
:return: API response
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
method = "GET"
|
|
27
|
+
|
|
28
|
+
try:
|
|
29
|
+
if method.upper() == 'POST':
|
|
30
|
+
response = requests.post(self.base_url, headers=self.headers, json=params)
|
|
31
|
+
else:
|
|
32
|
+
response = requests.get(self.base_url, headers=self.headers, params=params)
|
|
33
|
+
|
|
34
|
+
response.raise_for_status()
|
|
35
|
+
return response.json()
|
|
36
|
+
except requests.exceptions.RequestException as e:
|
|
37
|
+
print(f"An error occurred: {e}")
|
|
38
|
+
raise e
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name='apiverve_countydatalookup',
|
|
5
|
+
version='1.0.11',
|
|
6
|
+
packages=find_packages(),
|
|
7
|
+
include_package_data=True,
|
|
8
|
+
install_requires=[
|
|
9
|
+
'requests',
|
|
10
|
+
'setuptools'
|
|
11
|
+
],
|
|
12
|
+
description='County Data is a simple tool for getting data about US counties. It returns information such as population, area, and more based on the county name provided.',
|
|
13
|
+
author='APIVerve',
|
|
14
|
+
author_email='hello@apiverve.com',
|
|
15
|
+
url='https://apiverve.com',
|
|
16
|
+
classifiers=[
|
|
17
|
+
'Programming Language :: Python :: 3',
|
|
18
|
+
'Operating System :: OS Independent',
|
|
19
|
+
],
|
|
20
|
+
python_requires='>=3.6',
|
|
21
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Initialize test module
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from apiverve_countydatalookup.apiClient import CountydataAPIClient
|
|
3
|
+
|
|
4
|
+
class TestClient(unittest.TestCase):
|
|
5
|
+
|
|
6
|
+
def setUp(self):
|
|
7
|
+
self.api_key = 'test_api_key'
|
|
8
|
+
self.client = CountydataAPIClient(self.api_key)
|
|
9
|
+
|
|
10
|
+
def test_get(self):
|
|
11
|
+
# Assuming there's an endpoint 'test_endpoint' for testing purposes
|
|
12
|
+
try:
|
|
13
|
+
response = self.client.get('test_endpoint')
|
|
14
|
+
self.assertIsInstance(response, dict)
|
|
15
|
+
except Exception as e:
|
|
16
|
+
self.fail(f"GET request failed with exception {e}")
|
|
17
|
+
|
|
18
|
+
if __name__ == '__main__':
|
|
19
|
+
unittest.main()
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: apiverve-countydatalookup
|
|
3
|
+
Version: 1.0.11
|
|
4
|
+
Summary: County Data is a simple tool for getting data about US counties. It returns information such as population, area, and more based on the county name provided.
|
|
5
|
+
Author-email: APIVerve <hello@apiverve.com>
|
|
6
|
+
Project-URL: Homepage, https://apiverve.com
|
|
7
|
+
Keywords: county data,county data api,county data tool,county data software,county data service
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
14
|
+
Classifier: Intended Audience :: Healthcare Industry
|
|
15
|
+
Classifier: Intended Audience :: Education
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: Intended Audience :: Information Technology
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Classifier: Topic :: Utilities
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering
|
|
21
|
+
Classifier: Topic :: Education
|
|
22
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
|
|
23
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
|
|
24
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
26
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
27
|
+
Classifier: Topic :: Internet
|
|
28
|
+
Classifier: Topic :: Communications
|
|
29
|
+
Classifier: Topic :: Office/Business
|
|
30
|
+
Classifier: Topic :: Text Processing
|
|
31
|
+
Classifier: Topic :: Security
|
|
32
|
+
Classifier: Topic :: Database
|
|
33
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
34
|
+
Classifier: Topic :: Software Development :: Pre-processors
|
|
35
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
36
|
+
Classifier: Topic :: Software Development :: Testing
|
|
37
|
+
Classifier: Natural Language :: English
|
|
38
|
+
Requires-Python: >=3.12
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
License-File: LICENSE
|
|
41
|
+
|
|
42
|
+
County Data Lookup API
|
|
43
|
+
============
|
|
44
|
+
|
|
45
|
+
County Data is a simple tool for getting data about US counties. It returns information such as population, area, and more based on the county name provided.
|
|
46
|
+
|
|
47
|
+

|
|
48
|
+

|
|
49
|
+

|
|
50
|
+
|
|
51
|
+
This is a Python API Wrapper for the [County Data Lookup API](https://apiverve.com/marketplace/api/countydata)
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
56
|
+
pip install apiverve-countydatalookup
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
|
|
62
|
+
Before using the countydata API client, you have to setup your account and obtain your API Key.
|
|
63
|
+
You can get it by signing up at [https://apiverve.com](https://apiverve.com)
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Usage
|
|
68
|
+
|
|
69
|
+
The County Data Lookup API documentation is found here: [https://docs.apiverve.com/api/countydata](https://docs.apiverve.com/api/countydata).
|
|
70
|
+
You can find parameters, example responses, and status codes documented here.
|
|
71
|
+
|
|
72
|
+
### Setup
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
# Import the client module
|
|
76
|
+
from apiverve_countydatalookup.apiClient import CountydataAPIClient
|
|
77
|
+
|
|
78
|
+
# Initialize the client with your APIVerve API key
|
|
79
|
+
api = CountydataAPIClient("[YOUR_API_KEY]")
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
### Perform Request
|
|
86
|
+
Using the API client, you can perform requests to the API.
|
|
87
|
+
|
|
88
|
+
###### Define Query
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
query = { "state": "MO", "county": "Jackson" }
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
###### Simple Request
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
# Make a request to the API
|
|
98
|
+
result = api.execute(query)
|
|
99
|
+
|
|
100
|
+
# Print the result
|
|
101
|
+
print(result)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
###### Example Response
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
{
|
|
108
|
+
"status": "ok",
|
|
109
|
+
"error": null,
|
|
110
|
+
"data": {
|
|
111
|
+
"name": "jackson county",
|
|
112
|
+
"state": "MO",
|
|
113
|
+
"age": {
|
|
114
|
+
"85+": 0.019971238003388282
|
|
115
|
+
},
|
|
116
|
+
"male": 339932,
|
|
117
|
+
"female": 363079,
|
|
118
|
+
"deaths": {
|
|
119
|
+
"suicides": 106.71428571428571,
|
|
120
|
+
"firearm suicides": 55.095238095238095,
|
|
121
|
+
"homicides": 115.42857142857143,
|
|
122
|
+
"vehicle": 93
|
|
123
|
+
},
|
|
124
|
+
"avg_income": 47054,
|
|
125
|
+
"health": {
|
|
126
|
+
"poorHealth": 20.588989742,
|
|
127
|
+
"physicallyUnhealthyDays": 4.247736361,
|
|
128
|
+
"mentallyUnhealthyDays": 4.8111015035,
|
|
129
|
+
"lowBirthweightPercent": 9.1518749808,
|
|
130
|
+
"smokersPercent": 20.957241772,
|
|
131
|
+
"obesityPercent": 31.5,
|
|
132
|
+
"foodEnvIndex": 7.5,
|
|
133
|
+
"physicallyInactivePercent": 23.2,
|
|
134
|
+
"excessiveDrinkingPercent": 18.940103365,
|
|
135
|
+
"Teen Birth Rate": 31.109351559,
|
|
136
|
+
"% Uninsured": 12.486314662,
|
|
137
|
+
"% With Annual Mammogram": 45,
|
|
138
|
+
"% Vaccinated": 51,
|
|
139
|
+
"% Children in Poverty": 19.6,
|
|
140
|
+
"80th Percentile Income": 108296,
|
|
141
|
+
"20th Percentile Income": 23275,
|
|
142
|
+
"Violent Crime Rate": 941.43198334,
|
|
143
|
+
"Average Daily PM2.5": 9.1,
|
|
144
|
+
"% Severe Housing Problems": 15.347550638,
|
|
145
|
+
"% Drive Alone to Work": 83.470246386
|
|
146
|
+
},
|
|
147
|
+
"landAreaKM2": 1565.601892,
|
|
148
|
+
"areaKM2": 1596.319707,
|
|
149
|
+
"longitude": -94.347496655033936,
|
|
150
|
+
"latitude": 39.016701918102484,
|
|
151
|
+
"zipCodes": [
|
|
152
|
+
"64137",
|
|
153
|
+
"64111",
|
|
154
|
+
"64053",
|
|
155
|
+
"64055",
|
|
156
|
+
"64064",
|
|
157
|
+
"64029",
|
|
158
|
+
"64106",
|
|
159
|
+
"64108",
|
|
160
|
+
"64034",
|
|
161
|
+
"64118",
|
|
162
|
+
"64136",
|
|
163
|
+
"64139",
|
|
164
|
+
"64125",
|
|
165
|
+
"64030",
|
|
166
|
+
"64014",
|
|
167
|
+
"64066",
|
|
168
|
+
"64080",
|
|
169
|
+
"64123",
|
|
170
|
+
"64131",
|
|
171
|
+
"64145",
|
|
172
|
+
"64128",
|
|
173
|
+
"64121",
|
|
174
|
+
"64170",
|
|
175
|
+
"64050",
|
|
176
|
+
"64057",
|
|
177
|
+
"64133",
|
|
178
|
+
"64109",
|
|
179
|
+
"64130",
|
|
180
|
+
"64134",
|
|
181
|
+
"64129",
|
|
182
|
+
"64158",
|
|
183
|
+
"64163",
|
|
184
|
+
"64070",
|
|
185
|
+
"64102",
|
|
186
|
+
"64105",
|
|
187
|
+
"64086",
|
|
188
|
+
"64101",
|
|
189
|
+
"64124",
|
|
190
|
+
"64157",
|
|
191
|
+
"64088",
|
|
192
|
+
"64061",
|
|
193
|
+
"64051",
|
|
194
|
+
"64002",
|
|
195
|
+
"64081",
|
|
196
|
+
"64013",
|
|
197
|
+
"64016",
|
|
198
|
+
"64112",
|
|
199
|
+
"64114",
|
|
200
|
+
"64110",
|
|
201
|
+
"64152",
|
|
202
|
+
"64127",
|
|
203
|
+
"64147",
|
|
204
|
+
"64120",
|
|
205
|
+
"64146",
|
|
206
|
+
"64199",
|
|
207
|
+
"64058",
|
|
208
|
+
"64054",
|
|
209
|
+
"64074",
|
|
210
|
+
"64119",
|
|
211
|
+
"64138",
|
|
212
|
+
"64149",
|
|
213
|
+
"64156",
|
|
214
|
+
"64132",
|
|
215
|
+
"64171",
|
|
216
|
+
"64148",
|
|
217
|
+
"64141",
|
|
218
|
+
"64999",
|
|
219
|
+
"64052",
|
|
220
|
+
"64015",
|
|
221
|
+
"64063",
|
|
222
|
+
"64075",
|
|
223
|
+
"64056",
|
|
224
|
+
"64082",
|
|
225
|
+
"64113",
|
|
226
|
+
"64155",
|
|
227
|
+
"64126",
|
|
228
|
+
"64197",
|
|
229
|
+
"64065",
|
|
230
|
+
"64198"
|
|
231
|
+
],
|
|
232
|
+
"lifeExpectancy": 77.19,
|
|
233
|
+
"education": {
|
|
234
|
+
"bachelors+": 31.6,
|
|
235
|
+
"lessThanHighSchool": 9.4,
|
|
236
|
+
"highSchool": 28.3,
|
|
237
|
+
"someCollege": 30.7
|
|
238
|
+
},
|
|
239
|
+
"povertyRate": 13.7,
|
|
240
|
+
"costOfLiving": {
|
|
241
|
+
"living_wage": 14.55,
|
|
242
|
+
"food_costs": 3246,
|
|
243
|
+
"medical_costs": 2681,
|
|
244
|
+
"housing_costs": 8136,
|
|
245
|
+
"tax_costs": 6263
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Customer Support
|
|
254
|
+
|
|
255
|
+
Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact).
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Updates
|
|
260
|
+
Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Legal
|
|
265
|
+
|
|
266
|
+
All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms) and all legal documents and agreements.
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## License
|
|
271
|
+
Licensed under the The MIT License (MIT)
|
|
272
|
+
|
|
273
|
+
Copyright (©) 2024 APIVerve, and Evlar LLC
|
|
274
|
+
|
|
275
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
276
|
+
|
|
277
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
278
|
+
|
|
279
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/apiverve_countydatalookup/__init__.py
|
|
5
|
+
src/apiverve_countydatalookup/apiClient.py
|
|
6
|
+
src/apiverve_countydatalookup/exceptions.py
|
|
7
|
+
src/apiverve_countydatalookup/setup.py
|
|
8
|
+
src/apiverve_countydatalookup.egg-info/PKG-INFO
|
|
9
|
+
src/apiverve_countydatalookup.egg-info/SOURCES.txt
|
|
10
|
+
src/apiverve_countydatalookup.egg-info/dependency_links.txt
|
|
11
|
+
src/apiverve_countydatalookup.egg-info/top_level.txt
|
|
12
|
+
src/apiverve_countydatalookup/tests/__init__.py
|
|
13
|
+
src/apiverve_countydatalookup/tests/test_api.py
|
|
14
|
+
tests/test_api.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
apiverve_countydatalookup
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from apiverve_countydatalookup.apiClient import CountydataAPIClient
|
|
3
|
+
from unittest.mock import patch
|
|
4
|
+
|
|
5
|
+
class TestCountydataAPIClient(unittest.TestCase):
|
|
6
|
+
|
|
7
|
+
def setUp(self):
|
|
8
|
+
self.api_key = 'test_api_key'
|
|
9
|
+
self.client = CountydataAPIClient(self.api_key)
|
|
10
|
+
|
|
11
|
+
@patch('apiverve_countydatalookup.apiClient.requests.get')
|
|
12
|
+
def test_make_request_success(self, mock_get):
|
|
13
|
+
# Assuming there's an endpoint 'test_endpoint' for testing purposes
|
|
14
|
+
mock_get.return_value.status_code = 200
|
|
15
|
+
mock_get.return_value.json.return_value = {'test': 'test'}
|
|
16
|
+
response = self.client.get('test_endpoint')
|
|
17
|
+
self.assertIsInstance(response, dict)
|
|
18
|
+
|
|
19
|
+
@patch('apiverve_countydatalookup.apiClient.requests.get')
|
|
20
|
+
def test_make_request_failure(self, mock_get):
|
|
21
|
+
# Assuming there's an endpoint 'test_endpoint' for testing purposes
|
|
22
|
+
mock_get.return_value.status_code = 404
|
|
23
|
+
with self.assertRaises(Exception):
|
|
24
|
+
self.client.get('test_endpoint')
|
|
25
|
+
|
|
26
|
+
if __name__ == '__main__':
|
|
27
|
+
unittest.main()
|