smartystreets-python-sdk 8.1.0__tar.gz → 8.2.0__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-8.1.0 → smartystreets_python_sdk-8.2.0}/PKG-INFO +2 -2
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_postal_code/__init__.py +1 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_postal_code/candidate.py +1 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_postal_code/client.py +10 -0
- smartystreets_python_sdk-8.2.0/smartystreets_python_sdk/international_postal_code/lookup.py +43 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_street/client.py +2 -0
- smartystreets_python_sdk-8.2.0/smartystreets_python_sdk/international_street/language_mode.py +27 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_street/lookup.py +2 -0
- smartystreets_python_sdk-8.2.0/smartystreets_python_sdk/max_results.py +30 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk.egg-info/PKG-INFO +2 -2
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk.egg-info/SOURCES.txt +2 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk_version/__init__.py +1 -1
- smartystreets_python_sdk-8.1.0/smartystreets_python_sdk/international_postal_code/lookup.py +0 -27
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/LICENSE.md +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/README.md +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/setup.cfg +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/setup.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/__init__.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/basic_auth_credentials.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/batch.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/client_builder.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/custom_header_sender.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/custom_query_sender.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/errors.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/exceptions.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_autocomplete/__init__.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_autocomplete/candidate.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_autocomplete/client.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_autocomplete/language_mode.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_autocomplete/lookup.py +0 -0
- {smartystreets_python_sdk-8.1.0/smartystreets_python_sdk/international_street → smartystreets_python_sdk-8.2.0/smartystreets_python_sdk/international_postal_code}/language_mode.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_street/__init__.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_street/analysis.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_street/candidate.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_street/changes.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_street/components.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_street/metadata.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/international_street/rootlevel.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/license_sender.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/native_serializer.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/proxy.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/request.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/requests_sender.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/response.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/retry_sender.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/shared_credentials.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/signing_sender.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/static_credentials.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/status_code_sender.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/url_prefix_sender.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_autocomplete/__init__.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_autocomplete/client.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_autocomplete/geolocation_type.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_autocomplete/lookup.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_autocomplete/source.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_autocomplete/suggestion.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_autocomplete_pro/__init__.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_autocomplete_pro/client.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_autocomplete_pro/geolocation_type.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_autocomplete_pro/lookup.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_autocomplete_pro/source.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_autocomplete_pro/suggestion.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_enrichment/__init__.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_enrichment/business/__init__.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_enrichment/business/detail.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_enrichment/business/summary.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_enrichment/client.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_enrichment/lookup.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_enrichment/response.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_extract/__init__.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_extract/address.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_extract/client.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_extract/lookup.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_extract/metadata.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_extract/result.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_reverse_geo/__init__.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_reverse_geo/address.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_reverse_geo/client.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_reverse_geo/coordinate.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_reverse_geo/lookup.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_reverse_geo/response.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_reverse_geo/result.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_reverse_geo/source.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_street/__init__.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_street/analysis.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_street/candidate.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_street/client.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_street/component_analysis.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_street/components.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_street/lookup.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_street/match_info.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_street/match_type.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_street/metadata.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_street/output_format.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_zipcode/__init__.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_zipcode/alternate_county.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_zipcode/city.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_zipcode/client.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_zipcode/lookup.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_zipcode/result.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/us_zipcode/zipcode.py +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk.egg-info/dependency_links.txt +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk.egg-info/requires.txt +0 -0
- {smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/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: 8.
|
|
3
|
+
Version: 8.2.0
|
|
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/8.
|
|
6
|
+
Download-URL: https://github.com/smartystreets/smartystreets-python-sdk/tarball/8.2.0
|
|
7
7
|
Author: SmartyStreets SDK Team
|
|
8
8
|
Author-email: support@smartystreets.com
|
|
9
9
|
License: Apache 2
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from smartystreets_python_sdk import Request
|
|
2
2
|
from smartystreets_python_sdk.international_postal_code import Candidate
|
|
3
|
+
from smartystreets_python_sdk.international_postal_code.language_mode import LanguageMode
|
|
4
|
+
from smartystreets_python_sdk.max_results import normalize_max_results
|
|
3
5
|
|
|
4
6
|
class Client:
|
|
5
7
|
def __init__(self, sender, serializer):
|
|
@@ -24,9 +26,11 @@ class Client:
|
|
|
24
26
|
request = Request()
|
|
25
27
|
self.add_parameter(request, 'input_id', lookup.input_id)
|
|
26
28
|
self.add_parameter(request, 'country', lookup.country)
|
|
29
|
+
self.add_parameter(request, 'language', self.normalized_language(lookup.language))
|
|
27
30
|
self.add_parameter(request, 'locality', lookup.locality)
|
|
28
31
|
self.add_parameter(request, 'administrative_area', lookup.administrative_area)
|
|
29
32
|
self.add_parameter(request, 'postal_code', lookup.postal_code)
|
|
33
|
+
self.add_parameter(request, 'max_results', normalize_max_results(lookup.max_results))
|
|
30
34
|
return request
|
|
31
35
|
|
|
32
36
|
@staticmethod
|
|
@@ -37,3 +41,9 @@ class Client:
|
|
|
37
41
|
def add_parameter(request, key, value):
|
|
38
42
|
if value and value != 'none':
|
|
39
43
|
request.parameters[key] = value
|
|
44
|
+
|
|
45
|
+
@staticmethod
|
|
46
|
+
def normalized_language(language):
|
|
47
|
+
if language is None:
|
|
48
|
+
return None
|
|
49
|
+
return LanguageMode.from_value(language).value
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from smartystreets_python_sdk.international_postal_code.language_mode import LanguageMode
|
|
2
|
+
from smartystreets_python_sdk.max_results import normalize_max_results
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Lookup:
|
|
6
|
+
def __init__(self):
|
|
7
|
+
"""
|
|
8
|
+
In addition to holding all the input data for this lookup, this class also will contain the result
|
|
9
|
+
of the lookup after it comes back from the API.
|
|
10
|
+
|
|
11
|
+
See "https://smartystreets.com/docs/cloud/international-postal-code-api"
|
|
12
|
+
|
|
13
|
+
:field self.language: When not set, results are returned using the Latin character set.
|
|
14
|
+
When set to LanguageMode.NATIVE (JPN only), results are returned in the native character set for that country.
|
|
15
|
+
When set to LanguageMode.LATIN, results use the Latin character set with accents and other diacritics removed.
|
|
16
|
+
:field self.max_results: The maximum number of results to return. Sent only when greater than 0.
|
|
17
|
+
"""
|
|
18
|
+
self.results = []
|
|
19
|
+
|
|
20
|
+
self.input_id = None
|
|
21
|
+
self.country = None
|
|
22
|
+
self.language = None
|
|
23
|
+
self.locality = None
|
|
24
|
+
self.administrative_area = None
|
|
25
|
+
self.postal_code = None
|
|
26
|
+
self.max_results = None
|
|
27
|
+
|
|
28
|
+
def populate(self, params):
|
|
29
|
+
if self.input_id:
|
|
30
|
+
params['input_id'] = self.input_id
|
|
31
|
+
if self.country:
|
|
32
|
+
params['country'] = self.country
|
|
33
|
+
if self.language is not None:
|
|
34
|
+
params['language'] = LanguageMode.from_value(self.language).value
|
|
35
|
+
if self.locality:
|
|
36
|
+
params['locality'] = self.locality
|
|
37
|
+
if self.administrative_area:
|
|
38
|
+
params['administrative_area'] = self.administrative_area
|
|
39
|
+
if self.postal_code:
|
|
40
|
+
params['postal_code'] = self.postal_code
|
|
41
|
+
max_results = normalize_max_results(self.max_results)
|
|
42
|
+
if max_results is not None:
|
|
43
|
+
params['max_results'] = max_results
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from smartystreets_python_sdk import Request
|
|
2
2
|
from smartystreets_python_sdk.international_street import Candidate
|
|
3
3
|
from smartystreets_python_sdk.international_street.language_mode import LanguageMode
|
|
4
|
+
from smartystreets_python_sdk.max_results import normalize_max_results
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
class Client:
|
|
@@ -44,6 +45,7 @@ class Client:
|
|
|
44
45
|
self.add_parameter(request, 'administrative_area', lookup.administrative_area)
|
|
45
46
|
self.add_parameter(request, 'postal_code', lookup.postal_code)
|
|
46
47
|
self.add_parameter(request, 'features', lookup.features)
|
|
48
|
+
self.add_parameter(request, 'max_results', normalize_max_results(lookup.max_results))
|
|
47
49
|
|
|
48
50
|
for parameter in lookup.custom_parameter_array:
|
|
49
51
|
self.add_parameter(request, parameter, lookup.custom_parameter_array[parameter])
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
from smartystreets_python_sdk.exceptions import UnprocessableEntityError
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class LanguageMode(Enum):
|
|
7
|
+
"""
|
|
8
|
+
A closed set of valid Language values, the closest Python equivalent to an enum-constrained field.
|
|
9
|
+
"""
|
|
10
|
+
NATIVE = 'native'
|
|
11
|
+
LATIN = 'latin'
|
|
12
|
+
|
|
13
|
+
@staticmethod
|
|
14
|
+
def from_value(value):
|
|
15
|
+
"""
|
|
16
|
+
Resolves a LanguageMode instance or a raw value (eg. from user input or config) into a LanguageMode,
|
|
17
|
+
matching 'native'/'latin' regardless of case.
|
|
18
|
+
"""
|
|
19
|
+
if isinstance(value, LanguageMode):
|
|
20
|
+
return value
|
|
21
|
+
|
|
22
|
+
for mode in LanguageMode:
|
|
23
|
+
if str(value).lower() == mode.value:
|
|
24
|
+
return mode
|
|
25
|
+
|
|
26
|
+
raise UnprocessableEntityError(
|
|
27
|
+
"invalid Language value; must be unset, 'native', or 'latin' (case-insensitive)")
|
|
@@ -17,6 +17,7 @@ class Lookup:
|
|
|
17
17
|
:field self.language: When not set, the output language will match the language of the input values.
|
|
18
18
|
When set to language_mode.NATIVE, the results will always be in the language of the output country.
|
|
19
19
|
When set to language_mode.LATIN, the results will always be provided using a Latin character set.
|
|
20
|
+
:field self.max_results: The maximum number of candidates to return. Sent only when greater than 0.
|
|
20
21
|
"""
|
|
21
22
|
self.result = []
|
|
22
23
|
|
|
@@ -35,6 +36,7 @@ class Lookup:
|
|
|
35
36
|
self.administrative_area = None
|
|
36
37
|
self.postal_code = None
|
|
37
38
|
self.features = None
|
|
39
|
+
self.max_results = None
|
|
38
40
|
|
|
39
41
|
@property
|
|
40
42
|
def missing_country(self):
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from smartystreets_python_sdk.exceptions import UnprocessableEntityError
|
|
4
|
+
|
|
5
|
+
_WHOLE_NUMBER = re.compile(r'\s*[+-]?\d+\s*')
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def normalize_max_results(value):
|
|
9
|
+
"""
|
|
10
|
+
Shared handling for the max_results input: accepts a whole number (or a string holding one),
|
|
11
|
+
and returns it as an int only when it is above 0. Returns None when it shouldn't be sent
|
|
12
|
+
(unset, blank, or 0 and below); anything that isn't a whole number raises.
|
|
13
|
+
"""
|
|
14
|
+
if value is None or (isinstance(value, str) and not value.strip()):
|
|
15
|
+
return None
|
|
16
|
+
|
|
17
|
+
number = None
|
|
18
|
+
if isinstance(value, bool):
|
|
19
|
+
number = None
|
|
20
|
+
elif isinstance(value, int):
|
|
21
|
+
number = value
|
|
22
|
+
elif isinstance(value, float) and value.is_integer():
|
|
23
|
+
number = int(value)
|
|
24
|
+
elif isinstance(value, str) and _WHOLE_NUMBER.fullmatch(value):
|
|
25
|
+
number = int(value)
|
|
26
|
+
|
|
27
|
+
if number is None:
|
|
28
|
+
raise UnprocessableEntityError("invalid max_results value; must be a whole number")
|
|
29
|
+
|
|
30
|
+
return number if number > 0 else None
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: smartystreets_python_sdk
|
|
3
|
-
Version: 8.
|
|
3
|
+
Version: 8.2.0
|
|
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/8.
|
|
6
|
+
Download-URL: https://github.com/smartystreets/smartystreets-python-sdk/tarball/8.2.0
|
|
7
7
|
Author: SmartyStreets SDK Team
|
|
8
8
|
Author-email: support@smartystreets.com
|
|
9
9
|
License: Apache 2
|
|
@@ -11,6 +11,7 @@ smartystreets_python_sdk/custom_query_sender.py
|
|
|
11
11
|
smartystreets_python_sdk/errors.py
|
|
12
12
|
smartystreets_python_sdk/exceptions.py
|
|
13
13
|
smartystreets_python_sdk/license_sender.py
|
|
14
|
+
smartystreets_python_sdk/max_results.py
|
|
14
15
|
smartystreets_python_sdk/native_serializer.py
|
|
15
16
|
smartystreets_python_sdk/proxy.py
|
|
16
17
|
smartystreets_python_sdk/request.py
|
|
@@ -35,6 +36,7 @@ smartystreets_python_sdk/international_autocomplete/lookup.py
|
|
|
35
36
|
smartystreets_python_sdk/international_postal_code/__init__.py
|
|
36
37
|
smartystreets_python_sdk/international_postal_code/candidate.py
|
|
37
38
|
smartystreets_python_sdk/international_postal_code/client.py
|
|
39
|
+
smartystreets_python_sdk/international_postal_code/language_mode.py
|
|
38
40
|
smartystreets_python_sdk/international_postal_code/lookup.py
|
|
39
41
|
smartystreets_python_sdk/international_street/__init__.py
|
|
40
42
|
smartystreets_python_sdk/international_street/analysis.py
|
|
@@ -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__="8.
|
|
2
|
+
__version__="8.2.0"
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
class Lookup:
|
|
2
|
-
def __init__(self):
|
|
3
|
-
"""
|
|
4
|
-
In addition to holding all the input data for this lookup, this class also will contain the result
|
|
5
|
-
of the lookup after it comes back from the API.
|
|
6
|
-
|
|
7
|
-
See "https://smartystreets.com/docs/cloud/international-postal-code-api"
|
|
8
|
-
"""
|
|
9
|
-
self.results = []
|
|
10
|
-
|
|
11
|
-
self.input_id = None
|
|
12
|
-
self.country = None
|
|
13
|
-
self.locality = None
|
|
14
|
-
self.administrative_area = None
|
|
15
|
-
self.postal_code = None
|
|
16
|
-
|
|
17
|
-
def populate(self, params):
|
|
18
|
-
if self.input_id:
|
|
19
|
-
params['input_id'] = self.input_id
|
|
20
|
-
if self.country:
|
|
21
|
-
params['country'] = self.country
|
|
22
|
-
if self.locality:
|
|
23
|
-
params['locality'] = self.locality
|
|
24
|
-
if self.administrative_area:
|
|
25
|
-
params['administrative_area'] = self.administrative_area
|
|
26
|
-
if self.postal_code:
|
|
27
|
-
params['postal_code'] = self.postal_code
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/smartystreets_python_sdk/batch.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/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
|
{smartystreets_python_sdk-8.1.0 → smartystreets_python_sdk-8.2.0}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|