From 2ca2105eb759138878de12b00e12799bcf315080 Mon Sep 17 00:00:00 2001 From: Sameer Kumar Date: Mon, 24 Aug 2026 15:24:15 +0700 Subject: [PATCH] fix(python): correct shipment and smart_rate service names in examples Two Python examples reference client properties that do not exist on EasyPostClient, so they raise AttributeError when run as published: - pagination/get-next-page.py used `client.shipments.get_next_page(...)`; the service is `self.shipment`. The same file already calls `client.shipment.all()` two lines earlier, so it was internally inconsistent. - smartrate/retrieve-standalone-smartrate-deliver-{by,on}.py used `client.smartrate.*`; the service is `self.smart_rate`. The service class is `SmartRateService` (in smartrate_service.py), which is the likely source of the confusion. Verified against easypost-python v10.7.0 (current PyPI release) and the v8.2.1/v9.5.0 tags, so the v8 and v9 example directories are affected too. The client defines no __getattr__ or aliases, so these are hard failures rather than tolerated spellings. The methods themselves were correct: `get_next_page` exists on ShipmentService, and `estimate_delivery_date`/`recommend_ship_date` on SmartRateService. Only the property names were wrong. --- official/docs/python/current/pagination/get-next-page.py | 2 +- .../smartrate/retrieve-standalone-smartrate-deliver-by.py | 2 +- .../smartrate/retrieve-standalone-smartrate-deliver-on.py | 2 +- official/docs/python/v8/pagination/get-next-page.py | 2 +- official/docs/python/v9/pagination/get-next-page.py | 2 +- .../v9/smartrate/retrieve-standalone-smartrate-deliver-by.py | 2 +- .../v9/smartrate/retrieve-standalone-smartrate-deliver-on.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/official/docs/python/current/pagination/get-next-page.py b/official/docs/python/current/pagination/get-next-page.py index 5e7e1041..1fcc8496 100644 --- a/official/docs/python/current/pagination/get-next-page.py +++ b/official/docs/python/current/pagination/get-next-page.py @@ -8,6 +8,6 @@ ) # Provide the previous results page to move onto the next page -next_page = client.shipments.get_next_page(shipments) +next_page = client.shipment.get_next_page(shipments) print(next_page) diff --git a/official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-by.py b/official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-by.py index 392e4278..109337c6 100644 --- a/official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-by.py +++ b/official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-by.py @@ -2,7 +2,7 @@ client = easypost.EasyPostClient("EASYPOST_API_KEY") -results = client.smartrate.estimate_delivery_date( +results = client.smart_rate.estimate_delivery_date( from_zip="10001", to_zip="10002", planned_ship_date="2024-07-18", diff --git a/official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-on.py b/official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-on.py index b43b13e7..c18971d8 100644 --- a/official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-on.py +++ b/official/docs/python/current/smartrate/retrieve-standalone-smartrate-deliver-on.py @@ -2,7 +2,7 @@ client = easypost.EasyPostClient("EASYPOST_API_KEY") -results = client.smartrate.recommend_ship_date( +results = client.smart_rate.recommend_ship_date( from_zip="10001", to_zip="10002", desired_delivery_date="2024-07-18", diff --git a/official/docs/python/v8/pagination/get-next-page.py b/official/docs/python/v8/pagination/get-next-page.py index 5e7e1041..1fcc8496 100644 --- a/official/docs/python/v8/pagination/get-next-page.py +++ b/official/docs/python/v8/pagination/get-next-page.py @@ -8,6 +8,6 @@ ) # Provide the previous results page to move onto the next page -next_page = client.shipments.get_next_page(shipments) +next_page = client.shipment.get_next_page(shipments) print(next_page) diff --git a/official/docs/python/v9/pagination/get-next-page.py b/official/docs/python/v9/pagination/get-next-page.py index 5e7e1041..1fcc8496 100644 --- a/official/docs/python/v9/pagination/get-next-page.py +++ b/official/docs/python/v9/pagination/get-next-page.py @@ -8,6 +8,6 @@ ) # Provide the previous results page to move onto the next page -next_page = client.shipments.get_next_page(shipments) +next_page = client.shipment.get_next_page(shipments) print(next_page) diff --git a/official/docs/python/v9/smartrate/retrieve-standalone-smartrate-deliver-by.py b/official/docs/python/v9/smartrate/retrieve-standalone-smartrate-deliver-by.py index 392e4278..109337c6 100644 --- a/official/docs/python/v9/smartrate/retrieve-standalone-smartrate-deliver-by.py +++ b/official/docs/python/v9/smartrate/retrieve-standalone-smartrate-deliver-by.py @@ -2,7 +2,7 @@ client = easypost.EasyPostClient("EASYPOST_API_KEY") -results = client.smartrate.estimate_delivery_date( +results = client.smart_rate.estimate_delivery_date( from_zip="10001", to_zip="10002", planned_ship_date="2024-07-18", diff --git a/official/docs/python/v9/smartrate/retrieve-standalone-smartrate-deliver-on.py b/official/docs/python/v9/smartrate/retrieve-standalone-smartrate-deliver-on.py index b43b13e7..c18971d8 100644 --- a/official/docs/python/v9/smartrate/retrieve-standalone-smartrate-deliver-on.py +++ b/official/docs/python/v9/smartrate/retrieve-standalone-smartrate-deliver-on.py @@ -2,7 +2,7 @@ client = easypost.EasyPostClient("EASYPOST_API_KEY") -results = client.smartrate.recommend_ship_date( +results = client.smart_rate.recommend_ship_date( from_zip="10001", to_zip="10002", desired_delivery_date="2024-07-18",