smartystreets-python-sdk 6.2.0__tar.gz → 6.2.1__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.
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/PKG-INFO +2 -2
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/status_code_sender.py +28 -12
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk.egg-info/PKG-INFO +2 -2
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk_version/__init__.py +1 -1
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/LICENSE.md +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/README.md +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/setup.cfg +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/setup.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/__init__.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/basic_auth_credentials.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/batch.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/client_builder.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/custom_header_sender.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/custom_query_sender.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/errors.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/exceptions.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_autocomplete/__init__.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_autocomplete/candidate.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_autocomplete/client.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_autocomplete/lookup.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_postal_code/__init__.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_postal_code/candidate.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_postal_code/client.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_postal_code/lookup.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_street/__init__.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_street/analysis.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_street/candidate.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_street/changes.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_street/client.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_street/components.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_street/language_mode.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_street/lookup.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_street/metadata.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/international_street/rootlevel.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/license_sender.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/native_serializer.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/proxy.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/request.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/requests_sender.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/response.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/retry_sender.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/shared_credentials.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/signing_sender.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/static_credentials.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/url_prefix_sender.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_autocomplete_pro/__init__.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_autocomplete_pro/client.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_autocomplete_pro/geolocation_type.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_autocomplete_pro/lookup.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_autocomplete_pro/suggestion.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_enrichment/__init__.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_enrichment/business/__init__.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_enrichment/business/detail.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_enrichment/business/summary.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_enrichment/client.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_enrichment/lookup.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_enrichment/response.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_extract/__init__.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_extract/address.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_extract/client.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_extract/lookup.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_extract/metadata.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_extract/result.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_reverse_geo/__init__.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_reverse_geo/address.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_reverse_geo/client.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_reverse_geo/coordinate.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_reverse_geo/lookup.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_reverse_geo/response.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_reverse_geo/result.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_street/__init__.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_street/analysis.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_street/candidate.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_street/client.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_street/component_analysis.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_street/components.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_street/lookup.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_street/match_info.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_street/match_type.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_street/metadata.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_street/output_format.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_zipcode/__init__.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_zipcode/alternate_county.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_zipcode/city.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_zipcode/client.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_zipcode/lookup.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_zipcode/result.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/us_zipcode/zipcode.py +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk.egg-info/SOURCES.txt +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk.egg-info/dependency_links.txt +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk.egg-info/requires.txt +0 -0
- {smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk.egg-info/top_level.txt +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: smartystreets_python_sdk
|
|
3
|
-
Version: 6.2.
|
|
3
|
+
Version: 6.2.1
|
|
4
4
|
Summary: An official library to help Python developers easily access the SmartyStreets APIs
|
|
5
5
|
Home-page: https://github.com/smartystreets/smartystreets-python-sdk
|
|
6
|
-
Download-URL: https://github.com/smartystreets/smartystreets-python-sdk/tarball/6.2.
|
|
6
|
+
Download-URL: https://github.com/smartystreets/smartystreets-python-sdk/tarball/6.2.1
|
|
7
7
|
Author: SmartyStreets SDK Team
|
|
8
8
|
Author-email: support@smartystreets.com
|
|
9
9
|
License: Apache 2
|
|
@@ -8,18 +8,7 @@ class StatusCodeSender:
|
|
|
8
8
|
self.inner = inner
|
|
9
9
|
|
|
10
10
|
def parse_rate_limit_response(self, response):
|
|
11
|
-
|
|
12
|
-
response_json = json.loads(response.payload)
|
|
13
|
-
if response_json is not None:
|
|
14
|
-
errors_json = response_json.get('errors')
|
|
15
|
-
if errors_json is not None:
|
|
16
|
-
message = ''
|
|
17
|
-
for current_error in errors_json:
|
|
18
|
-
current_message = current_error.get('message')
|
|
19
|
-
if current_message is not None:
|
|
20
|
-
message = message + current_message + ' '
|
|
21
|
-
error_message = exceptions.TooManyRequestsError(message.rstrip())
|
|
22
|
-
return error_message
|
|
11
|
+
return messageFrom(response, exceptions.TooManyRequestsError(errors.TOO_MANY_REQUESTS))
|
|
23
12
|
|
|
24
13
|
def send(self, request):
|
|
25
14
|
response = self.inner.send(request)
|
|
@@ -29,11 +18,38 @@ class StatusCodeSender:
|
|
|
29
18
|
response.error = exceptions.NotModifiedError(errors.NOT_MODIFIED, response.find_header('etag'))
|
|
30
19
|
elif response.status_code == 429:
|
|
31
20
|
response.error = self.parse_rate_limit_response(response)
|
|
21
|
+
elif response.status_code in [400, 401, 402, 403, 413, 422]:
|
|
22
|
+
response.error = messageFrom(response, statuses.get(response.status_code))
|
|
32
23
|
else:
|
|
33
24
|
response.error = statuses.get(response.status_code)
|
|
34
25
|
|
|
35
26
|
return response
|
|
36
27
|
|
|
28
|
+
def messageFrom(response, fallback):
|
|
29
|
+
message = extract_message(response)
|
|
30
|
+
if message:
|
|
31
|
+
return type(fallback)(message)
|
|
32
|
+
else:
|
|
33
|
+
return fallback
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def extract_message(response):
|
|
37
|
+
try:
|
|
38
|
+
response_json = json.loads(response.payload)
|
|
39
|
+
except (ValueError, TypeError):
|
|
40
|
+
return ''
|
|
41
|
+
if response_json is None:
|
|
42
|
+
return ''
|
|
43
|
+
errors_json = response_json.get('errors')
|
|
44
|
+
if errors_json is None:
|
|
45
|
+
return ''
|
|
46
|
+
message = ''
|
|
47
|
+
for current_error in errors_json:
|
|
48
|
+
current_message = current_error.get('message')
|
|
49
|
+
if current_message is not None:
|
|
50
|
+
message = message + current_message + ' '
|
|
51
|
+
return message.rstrip()
|
|
52
|
+
|
|
37
53
|
|
|
38
54
|
def ok():
|
|
39
55
|
return None
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: smartystreets_python_sdk
|
|
3
|
-
Version: 6.2.
|
|
3
|
+
Version: 6.2.1
|
|
4
4
|
Summary: An official library to help Python developers easily access the SmartyStreets APIs
|
|
5
5
|
Home-page: https://github.com/smartystreets/smartystreets-python-sdk
|
|
6
|
-
Download-URL: https://github.com/smartystreets/smartystreets-python-sdk/tarball/6.2.
|
|
6
|
+
Download-URL: https://github.com/smartystreets/smartystreets-python-sdk/tarball/6.2.1
|
|
7
7
|
Author: SmartyStreets SDK Team
|
|
8
8
|
Author-email: support@smartystreets.com
|
|
9
9
|
License: Apache 2
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__version__ = '0.0.0' # DO NOT EDIT (this is updated by a build job when a new release is published)
|
|
2
|
-
__version__="6.2.
|
|
2
|
+
__version__="6.2.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/batch.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/errors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{smartystreets_python_sdk-6.2.0 → smartystreets_python_sdk-6.2.1}/smartystreets_python_sdk/proxy.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|