karrio-canadapost 2025.5.5__py3-none-any.whl → 2025.5.7__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.
- karrio/providers/canadapost/tracking.py +20 -0
- karrio/providers/canadapost/units.py +50 -0
- {karrio_canadapost-2025.5.5.dist-info → karrio_canadapost-2025.5.7.dist-info}/METADATA +1 -1
- {karrio_canadapost-2025.5.5.dist-info → karrio_canadapost-2025.5.7.dist-info}/RECORD +7 -7
- {karrio_canadapost-2025.5.5.dist-info → karrio_canadapost-2025.5.7.dist-info}/WHEEL +0 -0
- {karrio_canadapost-2025.5.5.dist-info → karrio_canadapost-2025.5.7.dist-info}/entry_points.txt +0 -0
- {karrio_canadapost-2025.5.5.dist-info → karrio_canadapost-2025.5.7.dist-info}/top_level.txt +0 -0
|
@@ -58,6 +58,26 @@ def _extract_tracking(
|
|
|
58
58
|
event.event_site, event.event_province, join=True, separator=", "
|
|
59
59
|
),
|
|
60
60
|
description=event.event_description,
|
|
61
|
+
timestamp=lib.fiso_timestamp(
|
|
62
|
+
lib.fdate(event.event_date, "%Y-%m-%d"),
|
|
63
|
+
lib.ftime(event.event_time, "%H:%M:%S"),
|
|
64
|
+
),
|
|
65
|
+
status=next(
|
|
66
|
+
(
|
|
67
|
+
s.name
|
|
68
|
+
for s in list(provider_units.TrackingStatus)
|
|
69
|
+
if event.event_identifier in s.value
|
|
70
|
+
),
|
|
71
|
+
None,
|
|
72
|
+
),
|
|
73
|
+
reason=next(
|
|
74
|
+
(
|
|
75
|
+
r.name
|
|
76
|
+
for r in list(provider_units.TrackingIncidentReason)
|
|
77
|
+
if event.event_identifier in r.value
|
|
78
|
+
),
|
|
79
|
+
None,
|
|
80
|
+
),
|
|
61
81
|
)
|
|
62
82
|
for event in events
|
|
63
83
|
],
|
|
@@ -195,6 +195,22 @@ class TrackingStatus(lib.Enum):
|
|
|
195
195
|
"1499",
|
|
196
196
|
]
|
|
197
197
|
in_transit = [""]
|
|
198
|
+
picked_up = [
|
|
199
|
+
"100",
|
|
200
|
+
"101",
|
|
201
|
+
"102",
|
|
202
|
+
"103",
|
|
203
|
+
"104",
|
|
204
|
+
"105",
|
|
205
|
+
"106",
|
|
206
|
+
"107",
|
|
207
|
+
"1400",
|
|
208
|
+
"1401",
|
|
209
|
+
"1402",
|
|
210
|
+
"1403",
|
|
211
|
+
"1404",
|
|
212
|
+
"1405",
|
|
213
|
+
]
|
|
198
214
|
on_hold = [
|
|
199
215
|
"117",
|
|
200
216
|
"120",
|
|
@@ -273,6 +289,40 @@ class TrackingStatus(lib.Enum):
|
|
|
273
289
|
out_for_delivery = ["174", "500"]
|
|
274
290
|
|
|
275
291
|
|
|
292
|
+
class TrackingIncidentReason(lib.Enum):
|
|
293
|
+
"""Maps Canada Post exception codes to normalized TrackingIncidentReason.
|
|
294
|
+
|
|
295
|
+
Based on Canada Post tracking event codes.
|
|
296
|
+
"""
|
|
297
|
+
# Carrier-caused issues
|
|
298
|
+
carrier_damaged_parcel = ["119", "142", "143", "144", "145", "146", "147", "148", "149"]
|
|
299
|
+
carrier_sorting_error = ["128", "129", "130", "131", "132", "133"]
|
|
300
|
+
carrier_address_not_found = ["122", "123", "1413", "1440", "1485", "1486", "1489", "1490"]
|
|
301
|
+
carrier_parcel_lost = ["124", "126", "151", "152", "153"]
|
|
302
|
+
carrier_not_enough_time = ["155", "157", "158"]
|
|
303
|
+
carrier_vehicle_issue = ["134", "135", "136", "137", "138"]
|
|
304
|
+
|
|
305
|
+
# Consignee-caused issues
|
|
306
|
+
consignee_refused = ["150", "1415", "1416"]
|
|
307
|
+
consignee_business_closed = ["179", "181", "182"]
|
|
308
|
+
consignee_not_available = ["183", "184", "190", "1418", "1419", "1420"]
|
|
309
|
+
consignee_not_home = ["167", "168", "169", "1417"]
|
|
310
|
+
consignee_incorrect_address = ["172", "173", "1482", "1483"]
|
|
311
|
+
consignee_access_restricted = ["154", "180", "185", "186", "187", "188", "189"]
|
|
312
|
+
|
|
313
|
+
# Customs-related issues
|
|
314
|
+
customs_delay = ["810", "1443", "1484", "1487"]
|
|
315
|
+
customs_documentation = ["117", "120", "121"]
|
|
316
|
+
customs_duties_unpaid = ["125", "127", "1494"]
|
|
317
|
+
|
|
318
|
+
# Weather/Force majeure
|
|
319
|
+
weather_delay = ["159", "160", "161", "162", "163"]
|
|
320
|
+
natural_disaster = ["164", "165", "166"]
|
|
321
|
+
|
|
322
|
+
# Other issues
|
|
323
|
+
unknown = []
|
|
324
|
+
|
|
325
|
+
|
|
276
326
|
INTERNATIONAL_NON_DELIVERY_OPTION = [
|
|
277
327
|
ShippingOption.canadapost_return_at_senders_expense.name,
|
|
278
328
|
ShippingOption.canadapost_return_to_sender.name,
|
|
@@ -7,8 +7,8 @@ karrio/providers/canadapost/__init__.py,sha256=3UB1PI83_GZt2e0mQf_9lIye1vXjUwuMH
|
|
|
7
7
|
karrio/providers/canadapost/error.py,sha256=xkNQE4kj-MvACCxQUHoI7Xj-JiofFHIL4eFOIsJZ3Tg,1185
|
|
8
8
|
karrio/providers/canadapost/manifest.py,sha256=8kX-1CV_5JAjp978s_eHy4HlHqkcpkbG0bRclkyGqBc,4674
|
|
9
9
|
karrio/providers/canadapost/rate.py,sha256=35tGjUjtF2AwPSv8RWfbHGDFHvQ5Eg2OoTLny30UFC8,7261
|
|
10
|
-
karrio/providers/canadapost/tracking.py,sha256=
|
|
11
|
-
karrio/providers/canadapost/units.py,sha256=
|
|
10
|
+
karrio/providers/canadapost/tracking.py,sha256=F84O2mW1oir8R2tDH0jCBN9KstN7ANtRRhBteUVN4mk,3540
|
|
11
|
+
karrio/providers/canadapost/units.py,sha256=xfJVYVTgVWDCEk6VyUKupsnP1Aj_Gobh1PZvWTPxksU,9989
|
|
12
12
|
karrio/providers/canadapost/utils.py,sha256=xoRVwEjDmdJ8qg-88WYmz-0zGTzQC1i8D-U_9J7G09s,2515
|
|
13
13
|
karrio/providers/canadapost/pickup/__init__.py,sha256=uLN8GzjaW1ezPty1NxIKKFouHwkMGeYsdK_yAg7OwxE,304
|
|
14
14
|
karrio/providers/canadapost/pickup/cancel.py,sha256=io3_KxVzwAkH1zcIc1ycPwf_Up16mI_pgT84BCu0P3k,1001
|
|
@@ -34,8 +34,8 @@ karrio/schemas/canadapost/rating.py,sha256=Iaoagbm6L6A62GwI4PRB_2ZGZ1WpIbtogn9vg
|
|
|
34
34
|
karrio/schemas/canadapost/serviceinfo.py,sha256=gV0CYy7rcoTcVOYmKL9nLCqdVeQVERK8_vNvk9jn8eM,60134
|
|
35
35
|
karrio/schemas/canadapost/shipment.py,sha256=5xbnYyC8Mufsv2DJ11wk45yx1e2fK84UO-_3SSt5i-k,525576
|
|
36
36
|
karrio/schemas/canadapost/track.py,sha256=Va7-OB0sztIz9pu0VaTKaNDMUVPC1AXCTPDePdyX84Q,150548
|
|
37
|
-
karrio_canadapost-2025.5.
|
|
38
|
-
karrio_canadapost-2025.5.
|
|
39
|
-
karrio_canadapost-2025.5.
|
|
40
|
-
karrio_canadapost-2025.5.
|
|
41
|
-
karrio_canadapost-2025.5.
|
|
37
|
+
karrio_canadapost-2025.5.7.dist-info/METADATA,sha256=sqnWFcUTV9H5Cqg4vxRXqs48JVqD67Mt1I_5mvVOOhQ,1016
|
|
38
|
+
karrio_canadapost-2025.5.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
39
|
+
karrio_canadapost-2025.5.7.dist-info/entry_points.txt,sha256=dU9l-mw14-Lg7pHChydFReVeE2OV8wwOM15AQQkbhvw,65
|
|
40
|
+
karrio_canadapost-2025.5.7.dist-info/top_level.txt,sha256=FZCY8Nwft8oEGHdl--xku8P3TrnOxu5dETEU_fWpRSM,20
|
|
41
|
+
karrio_canadapost-2025.5.7.dist-info/RECORD,,
|
|
File without changes
|
{karrio_canadapost-2025.5.5.dist-info → karrio_canadapost-2025.5.7.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|