From 2f88542f6259b862dfdc186094b4543b26ea9c09 Mon Sep 17 00:00:00 2001 From: Andy Johnson Date: Mon, 8 Jun 2026 16:02:15 -0600 Subject: [PATCH 1/2] Sync international street candidate fields --- .../international_street/changes.py | 1 + .../international_street/components.py | 8 +++- .../international_street/rootlevel.py | 6 +-- test/international_street/candidate_test.py | 40 ++++++++++--------- 4 files changed, 30 insertions(+), 25 deletions(-) diff --git a/smartystreets_python_sdk/international_street/changes.py b/smartystreets_python_sdk/international_street/changes.py index 9a5ce87..487abd0 100644 --- a/smartystreets_python_sdk/international_street/changes.py +++ b/smartystreets_python_sdk/international_street/changes.py @@ -4,4 +4,5 @@ class Changes(RootLevel): def __init__(self, obj): RootLevel.__init__(self, obj) + self.country = obj.get("country", None) self.components = Components(obj.get("components", {})) diff --git a/smartystreets_python_sdk/international_street/components.py b/smartystreets_python_sdk/international_street/components.py index 654abc0..a4c3eaa 100644 --- a/smartystreets_python_sdk/international_street/components.py +++ b/smartystreets_python_sdk/international_street/components.py @@ -7,8 +7,7 @@ def __init__(self, obj): self.super_administrative_area = obj.get("super_administrative_area", None) self.administrative_area = obj.get("administrative_area", None) self.administrative_area_iso2 = obj.get("administrative_area_iso2", None) - self.administrative_area_short = obj.get("administrative_area_short", None) - self.administrative_area_long = obj.get("administrative_area_long", None) + self.attention = obj.get("attention", None) self.sub_administrative_area = obj.get("sub_administrative_area", None) self.dependent_locality= obj.get("dependent_locality", None) self.dependent_locality_name = obj.get("dependent_locality_name", None) @@ -22,6 +21,11 @@ def __init__(self, obj): self.premise_number = obj.get("premise_number", None) self.premise_prefix_number = obj.get("premise_prefix_number", None) self.premise_type = obj.get("premise_type", None) + self.short_address_code = obj.get("short_address_code", None) + self.sub_building_leading_type = obj.get("sub_building_leading_type", None) + self.sub_building_block = obj.get("sub_building_block", None) + self.sub_building_door = obj.get("sub_building_door", None) + self.sub_building_staircase = obj.get("sub_building_staircase", None) self.thoroughfare = obj.get("thoroughfare", None) self.thoroughfare_predirection = obj.get("thoroughfare_predirection", None) self.thoroughfare_postdirection = obj.get("thoroughfare_postdirection", None) diff --git a/smartystreets_python_sdk/international_street/rootlevel.py b/smartystreets_python_sdk/international_street/rootlevel.py index a0ad65c..aac4fc7 100644 --- a/smartystreets_python_sdk/international_street/rootlevel.py +++ b/smartystreets_python_sdk/international_street/rootlevel.py @@ -9,8 +9,4 @@ def __init__(self, obj): self.address5 = obj.get("address5", None) self.address6 = obj.get("address6", None) self.address7 = obj.get("address7", None) - self.address8 = obj.get("address8", None) - self.address9 = obj.get("address9", None) - self.address10 = obj.get("address10", None) - self.address11 = obj.get("address11", None) - self.address12 = obj.get("address12", None) \ No newline at end of file + self.address8 = obj.get("address8", None) \ No newline at end of file diff --git a/test/international_street/candidate_test.py b/test/international_street/candidate_test.py index af7bfc2..90b59d3 100644 --- a/test/international_street/candidate_test.py +++ b/test/international_street/candidate_test.py @@ -8,14 +8,15 @@ class TestCandidate(unittest.TestCase): def test_all_fields_filled_correctly(self): response_payload = "[{\"input_id\":\"12345678\",\"organization\":\"1\",\"address1\":\"2\",\"address2\":\"3\","\ "\"address3\":\"4\",\"address4\":\"5\",\"address5\":\"6\",\"address6\":\"7\",\"address7\":\"8\","\ - "\"address8\":\"9\",\"address9\":\"10\",\"address10\":\"11\",\"address11\":\"12\",\"address12\":\"13\","\ + "\"address8\":\"9\","\ "\"components\":{\"country_iso_3\":\"14\",\"super_administrative_area\":\"15\","\ - "\"administrative_area\":\"16\",\"administrative_area_iso2\":\"16.1\",\"administrative_area_short\":\"16.2\",\"administrative_area_long\":\"16.3\","\ + "\"administrative_area\":\"16\",\"administrative_area_iso2\":\"16.1\",\"attention\":\"119\","\ "\"sub_administrative_area\":\"17\",\"dependent_locality\":\"18\","\ "\"dependent_locality_name\":\"19\",\"double_dependent_locality\":\"20\",\"locality\":\"21\","\ "\"postal_code\":\"22\",\"postal_code_short\":\"23\",\"postal_code_extra\":\"24\","\ "\"premise\":\"25\",\"premise_extra\":\"26\",\"premise_number\":\"27\"," \ "\"premise_prefix_number\":\"27.5\",\"premise_type\":\"28\","\ + "\"short_address_code\":\"120\",\"sub_building_leading_type\":\"121\",\"sub_building_block\":\"122\",\"sub_building_door\":\"123\",\"sub_building_staircase\":\"124\","\ "\"thoroughfare\":\"29\",\"thoroughfare_predirection\":\"30\",\"thoroughfare_postdirection\":\"31\","\ "\"thoroughfare_name\":\"32\",\"thoroughfare_trailing_type\":\"33\",\"thoroughfare_type\":\"34\","\ "\"dependent_thoroughfare\":\"35\",\"dependent_thoroughfare_predirection\":\"36\","\ @@ -33,14 +34,16 @@ def test_all_fields_filled_correctly(self): "\"analysis\":{\"verification_status\":\"57\",\"address_precision\":\"58\","\ "\"max_address_precision\":\"59\",\"changes\":{\"organization\":\"60\","\ "\"address1\":\"61\",\"address2\":\"62\",\"address3\":\"63\",\"address4\":\"64\",\"address5\":\"65\","\ - "\"address6\":\"66\",\"address7\":\"67\",\"address8\":\"68\",\"address9\":\"69\",\"address10\":\"70\","\ - "\"address11\":\"71\",\"address12\":\"72\",\"components\":{\"super_administrative_area\":\"73\"," \ - "\"administrative_area\":\"74\",\"administrative_area_short\":\"74.1\",\"administrative_area_long\":\"74.2\"," \ + "\"address6\":\"66\",\"address7\":\"67\",\"address8\":\"68\",\"country\":\"125\","\ + "\"components\":{\"super_administrative_area\":\"73\"," \ + "\"administrative_area\":\"74\",\"attention\":\"126\"," \ "\"sub_administrative_area\":\"75\",\"building\":\"76\","\ "\"dependent_locality\":\"77\",\"dependent_locality_name\":\"78\",\"double_dependent_locality\":\"79\","\ "\"country_iso_3\":\"80\",\"locality\":\"81\",\"postal_code\":\"82\",\"postal_code_short\":\"83\","\ "\"postal_code_extra\":\"84\",\"premise\":\"85\",\"premise_extra\":\"86\",\"premise_number\":\"87\","\ - "\"premise_type\":\"88\",\"premise_prefix_number\":\"89\",\"thoroughfare\":\"90\","\ + "\"premise_type\":\"88\",\"premise_prefix_number\":\"89\","\ + "\"short_address_code\":\"127\",\"sub_building_leading_type\":\"128\",\"sub_building_block\":\"129\",\"sub_building_door\":\"130\",\"sub_building_staircase\":\"131\","\ + "\"thoroughfare\":\"90\","\ "\"thoroughfare_predirection\":\"91\",\"thoroughfare_postdirection\":\"92\","\ "\"thoroughfare_name\":\"93\",\"thoroughfare_trailing_type\":\"94\",\"thoroughfare_type\":\"95\","\ "\"dependent_thoroughfare\":\"96\",\"dependent_thoroughfare_predirection\":\"97\","\ @@ -64,10 +67,6 @@ def test_all_fields_filled_correctly(self): self.assertEqual("7", candidate.address6) self.assertEqual("8", candidate.address7) self.assertEqual("9", candidate.address8) - self.assertEqual("10", candidate.address9) - self.assertEqual("11", candidate.address10) - self.assertEqual("12", candidate.address11) - self.assertEqual("13", candidate.address12) components = candidate.components self.assertIsNotNone(components) @@ -75,8 +74,7 @@ def test_all_fields_filled_correctly(self): self.assertEqual("15", components.super_administrative_area) self.assertEqual("16", components.administrative_area) self.assertEqual("16.1", components.administrative_area_iso2) - self.assertEqual("16.2", components.administrative_area_short) - self.assertEqual("16.3", components.administrative_area_long) + self.assertEqual("119", components.attention) self.assertEqual("17", components.sub_administrative_area) self.assertEqual("18", components.dependent_locality) self.assertEqual("19", components.dependent_locality_name) @@ -90,6 +88,11 @@ def test_all_fields_filled_correctly(self): self.assertEqual("27", components.premise_number) self.assertEqual("27.5", components.premise_prefix_number) self.assertEqual("28", components.premise_type) + self.assertEqual("120", components.short_address_code) + self.assertEqual("121", components.sub_building_leading_type) + self.assertEqual("122", components.sub_building_block) + self.assertEqual("123", components.sub_building_door) + self.assertEqual("124", components.sub_building_staircase) self.assertEqual("29", components.thoroughfare) self.assertEqual("30", components.thoroughfare_predirection) self.assertEqual("31", components.thoroughfare_postdirection) @@ -150,17 +153,13 @@ def test_all_fields_filled_correctly(self): self.assertEqual("66", changes.address6) self.assertEqual("67", changes.address7) self.assertEqual("68", changes.address8) - self.assertEqual("69", changes.address9) - self.assertEqual("70", changes.address10) - self.assertEqual("71", changes.address11) - self.assertEqual("72", changes.address12) + self.assertEqual("125", changes.country) components = changes.components self.assertIsNotNone(components) self.assertEqual("73", components.super_administrative_area) self.assertEqual("74", components.administrative_area) - self.assertEqual("74.1", components.administrative_area_short) - self.assertEqual("74.2", components.administrative_area_long) + self.assertEqual("126", components.attention) self.assertEqual("75", components.sub_administrative_area) self.assertEqual("76", components.building) self.assertEqual("77", components.dependent_locality) @@ -176,6 +175,11 @@ def test_all_fields_filled_correctly(self): self.assertEqual("87", components.premise_number) self.assertEqual("88", components.premise_type) self.assertEqual("89", components.premise_prefix_number) + self.assertEqual("127", components.short_address_code) + self.assertEqual("128", components.sub_building_leading_type) + self.assertEqual("129", components.sub_building_block) + self.assertEqual("130", components.sub_building_door) + self.assertEqual("131", components.sub_building_staircase) self.assertEqual("90", components.thoroughfare) self.assertEqual("91", components.thoroughfare_predirection) self.assertEqual("92", components.thoroughfare_postdirection) From 11d0f06f9da2af360feeeb432e07447dd16d150b Mon Sep 17 00:00:00 2001 From: Andy Johnson Date: Tue, 9 Jun 2026 11:51:46 -0600 Subject: [PATCH 2/2] Remove country field from international street Changes object --- smartystreets_python_sdk/international_street/changes.py | 1 - test/international_street/candidate_test.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/smartystreets_python_sdk/international_street/changes.py b/smartystreets_python_sdk/international_street/changes.py index 487abd0..9a5ce87 100644 --- a/smartystreets_python_sdk/international_street/changes.py +++ b/smartystreets_python_sdk/international_street/changes.py @@ -4,5 +4,4 @@ class Changes(RootLevel): def __init__(self, obj): RootLevel.__init__(self, obj) - self.country = obj.get("country", None) self.components = Components(obj.get("components", {})) diff --git a/test/international_street/candidate_test.py b/test/international_street/candidate_test.py index 90b59d3..b4c75ef 100644 --- a/test/international_street/candidate_test.py +++ b/test/international_street/candidate_test.py @@ -34,7 +34,7 @@ def test_all_fields_filled_correctly(self): "\"analysis\":{\"verification_status\":\"57\",\"address_precision\":\"58\","\ "\"max_address_precision\":\"59\",\"changes\":{\"organization\":\"60\","\ "\"address1\":\"61\",\"address2\":\"62\",\"address3\":\"63\",\"address4\":\"64\",\"address5\":\"65\","\ - "\"address6\":\"66\",\"address7\":\"67\",\"address8\":\"68\",\"country\":\"125\","\ + "\"address6\":\"66\",\"address7\":\"67\",\"address8\":\"68\","\ "\"components\":{\"super_administrative_area\":\"73\"," \ "\"administrative_area\":\"74\",\"attention\":\"126\"," \ "\"sub_administrative_area\":\"75\",\"building\":\"76\","\ @@ -153,7 +153,6 @@ def test_all_fields_filled_correctly(self): self.assertEqual("66", changes.address6) self.assertEqual("67", changes.address7) self.assertEqual("68", changes.address8) - self.assertEqual("125", changes.country) components = changes.components self.assertIsNotNone(components)