karrio-australiapost 2026.1.3__py3-none-any.whl → 2026.1.5__py3-none-any.whl

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.
@@ -16,6 +16,7 @@ METADATA = metadata.PluginMetadata(
16
16
  is_hub=False,
17
17
  services=units.ShippingService,
18
18
  options=units.ShippingOption,
19
+ service_levels=units.DEFAULT_SERVICES,
19
20
  # New fields
20
21
  website="https://auspost.com.au/",
21
22
  documentation="https://developers.auspost.com.au/apis/shipping-and-tracking/reference",
@@ -1,5 +1,8 @@
1
+ import csv
2
+ import pathlib
1
3
  import karrio.lib as lib
2
4
  import karrio.core.units as units
5
+ import karrio.core.models as models
3
6
 
4
7
 
5
8
  class PackagingType(lib.StrEnum):
@@ -177,3 +180,45 @@ class TrackingIncidentReason(lib.Enum):
177
180
 
178
181
  # Unknown/Other
179
182
  unknown = []
183
+
184
+
185
+ def load_services_from_csv() -> list:
186
+ csv_path = pathlib.Path(__file__).resolve().parent / "services.csv"
187
+ if not csv_path.exists():
188
+ return []
189
+ services_dict: dict[str, dict] = {}
190
+ with open(csv_path, "r", encoding="utf-8") as f:
191
+ reader = csv.DictReader(f)
192
+ for row in reader:
193
+ service_code = row["service_code"]
194
+ karrio_service_code = ShippingService.map(service_code).name_or_key
195
+ if karrio_service_code not in services_dict:
196
+ services_dict[karrio_service_code] = {
197
+ "service_name": row["service_name"],
198
+ "service_code": karrio_service_code,
199
+ "currency": row.get("currency", "AUD"),
200
+ "min_weight": float(row["min_weight"]) if row.get("min_weight") else None,
201
+ "max_weight": float(row["max_weight"]) if row.get("max_weight") else None,
202
+ "max_length": float(row["max_length"]) if row.get("max_length") else None,
203
+ "max_width": float(row["max_width"]) if row.get("max_width") else None,
204
+ "max_height": float(row["max_height"]) if row.get("max_height") else None,
205
+ "weight_unit": "KG",
206
+ "dimension_unit": "CM",
207
+ "domicile": (row.get("domicile") or "").lower() == "true",
208
+ "international": True if (row.get("international") or "").lower() == "true" else None,
209
+ "zones": [],
210
+ }
211
+ country_codes = [c.strip() for c in row.get("country_codes", "").split(",") if c.strip()]
212
+ zone = models.ServiceZone(
213
+ label=row.get("zone_label", "Default Zone"),
214
+ rate=float(row.get("rate", 0.0)),
215
+ min_weight=float(row["min_weight"]) if row.get("min_weight") else None,
216
+ max_weight=float(row["max_weight"]) if row.get("max_weight") else None,
217
+ transit_days=int(row["transit_days"].split("-")[0]) if row.get("transit_days") and row["transit_days"].split("-")[0].isdigit() else None,
218
+ country_codes=country_codes if country_codes else None,
219
+ )
220
+ services_dict[karrio_service_code]["zones"].append(zone)
221
+ return [models.ServiceLevel(**service_data) for service_data in services_dict.values()]
222
+
223
+
224
+ DEFAULT_SERVICES = load_services_from_csv()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: karrio_australiapost
3
- Version: 2026.1.3
3
+ Version: 2026.1.5
4
4
  Summary: Karrio - Australia Post Shipping Extension
5
5
  Author-email: karrio <hello@karrio.io>
6
6
  License-Expression: LGPL-3.0
@@ -2,13 +2,13 @@ karrio/mappers/australiapost/__init__.py,sha256=gdwZP5rAbHBzBYPsAk_aSSc4HLKZ8U0s
2
2
  karrio/mappers/australiapost/mapper.py,sha256=5uT04xqPKtK0t8vKzkITrx08IBsyt6AiKcC_2lfCQBQ,2388
3
3
  karrio/mappers/australiapost/proxy.py,sha256=t-6J1rmWvEObfbjaQoyYnA70VdtykSqLt27mdYGrp-I,5761
4
4
  karrio/mappers/australiapost/settings.py,sha256=6TtCpVQxeGu6RhywXjODXP1v45TpFHbjCEUkFJ_3hn0,533
5
- karrio/plugins/australiapost/__init__.py,sha256=jXITKInqTPA50ndyCqX3YCxHSGiKf6ppu51FqVUb4Y0,846
5
+ karrio/plugins/australiapost/__init__.py,sha256=_qLNWlVoeWlJYK80ziw1UAwkcFuTl5QEH20KXh7KZLs,889
6
6
  karrio/providers/australiapost/__init__.py,sha256=wr8vOf71vV5K-byodxnJN-IGXjoZN0epst5JfPwNWJc,526
7
7
  karrio/providers/australiapost/error.py,sha256=yu_hk3815dVGPGmDyi1VWRTw7CCrWh83jREG2-vnZF8,1356
8
8
  karrio/providers/australiapost/manifest.py,sha256=DfA7_UklLpy5ft38RI-pdTI-TcFfC6zEJzuNbaHNCL0,2012
9
9
  karrio/providers/australiapost/rate.py,sha256=ZxXo1gvFfPSsMWYO6BJs8bNsJHfeBHUAuOYRWPef_uw,4629
10
10
  karrio/providers/australiapost/tracking.py,sha256=UmlomqDHl0lLDr4wN3UAGnmZ5YgsSrxXQTGRKPanMNA,3403
11
- karrio/providers/australiapost/units.py,sha256=J1o8Lrb2pgct94txAwCjUupf51bHDoptMA4o8uJtuto,6497
11
+ karrio/providers/australiapost/units.py,sha256=D9NQI6dQ82a0an-vN0-mLVV9VXKBaISJNiJI4bgIQPw,8956
12
12
  karrio/providers/australiapost/utils.py,sha256=C4zl1UvvS88klCkHwO3mL3B9PFtjClQfE02NR4uKRZs,811
13
13
  karrio/providers/australiapost/shipment/__init__.py,sha256=EUEVig9vqFtga-V6hNRuOAR3IAKko-YjzmOZs5ZK6Es,243
14
14
  karrio/providers/australiapost/shipment/cancel.py,sha256=mLr3gLK4bhs8em-4JF4ePPHLT5iXdOdCF4J0_CRnPLc,1123
@@ -25,8 +25,8 @@ karrio/schemas/australiapost/shipment_request.py,sha256=0N9gGu-yTygUpoAfr_Y7ArOk
25
25
  karrio/schemas/australiapost/shipment_response.py,sha256=rsf--85LvHgpEFGfmH4H6T9CKeOBAe0alZe2DTjUPgk,2164
26
26
  karrio/schemas/australiapost/tracking_request.py,sha256=b0L2oWnZaAk1B1vSxTszgXoAF9w_AAmWHbvmoqEUN2E,143
27
27
  karrio/schemas/australiapost/tracking_response.py,sha256=HOfF1WdNDqqvA3uuDyNy6LtRTjIO5zsd0SkziH2Vz5k,1778
28
- karrio_australiapost-2026.1.3.dist-info/METADATA,sha256=irywRC2AocBgpTzOfAzCIC1zrBFuxanxF_KxEfX5Okc,1041
29
- karrio_australiapost-2026.1.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
30
- karrio_australiapost-2026.1.3.dist-info/entry_points.txt,sha256=B9zw0Kzq7I5KIPK5WeNs7h6GzvxEIdBVHK-YCMFFhh8,71
31
- karrio_australiapost-2026.1.3.dist-info/top_level.txt,sha256=FZCY8Nwft8oEGHdl--xku8P3TrnOxu5dETEU_fWpRSM,20
32
- karrio_australiapost-2026.1.3.dist-info/RECORD,,
28
+ karrio_australiapost-2026.1.5.dist-info/METADATA,sha256=zq5EwPSf4TmjnhvRGCo5MocQexNRMPUrrOHuJCjI0y8,1041
29
+ karrio_australiapost-2026.1.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
30
+ karrio_australiapost-2026.1.5.dist-info/entry_points.txt,sha256=B9zw0Kzq7I5KIPK5WeNs7h6GzvxEIdBVHK-YCMFFhh8,71
31
+ karrio_australiapost-2026.1.5.dist-info/top_level.txt,sha256=FZCY8Nwft8oEGHdl--xku8P3TrnOxu5dETEU_fWpRSM,20
32
+ karrio_australiapost-2026.1.5.dist-info/RECORD,,