karrio-seko 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.
- karrio/plugins/seko/__init__.py +1 -0
- karrio/providers/seko/units.py +45 -0
- {karrio_seko-2026.1.3.dist-info → karrio_seko-2026.1.5.dist-info}/METADATA +1 -1
- {karrio_seko-2026.1.3.dist-info → karrio_seko-2026.1.5.dist-info}/RECORD +7 -7
- {karrio_seko-2026.1.3.dist-info → karrio_seko-2026.1.5.dist-info}/WHEEL +0 -0
- {karrio_seko-2026.1.3.dist-info → karrio_seko-2026.1.5.dist-info}/entry_points.txt +0 -0
- {karrio_seko-2026.1.3.dist-info → karrio_seko-2026.1.5.dist-info}/top_level.txt +0 -0
karrio/plugins/seko/__init__.py
CHANGED
karrio/providers/seko/units.py
CHANGED
|
@@ -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 LabelType(lib.Enum):
|
|
@@ -281,3 +284,45 @@ class TrackingIncidentReason(lib.Enum):
|
|
|
281
284
|
|
|
282
285
|
# Unknown/Other
|
|
283
286
|
unknown = []
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
def load_services_from_csv() -> list:
|
|
290
|
+
csv_path = pathlib.Path(__file__).resolve().parent / "services.csv"
|
|
291
|
+
if not csv_path.exists():
|
|
292
|
+
return []
|
|
293
|
+
services_dict: dict[str, dict] = {}
|
|
294
|
+
with open(csv_path, "r", encoding="utf-8") as f:
|
|
295
|
+
reader = csv.DictReader(f)
|
|
296
|
+
for row in reader:
|
|
297
|
+
service_code = row["service_code"]
|
|
298
|
+
karrio_service_code = ShippingService.map(service_code).name_or_key
|
|
299
|
+
if karrio_service_code not in services_dict:
|
|
300
|
+
services_dict[karrio_service_code] = {
|
|
301
|
+
"service_name": row["service_name"],
|
|
302
|
+
"service_code": karrio_service_code,
|
|
303
|
+
"currency": row.get("currency", "USD"),
|
|
304
|
+
"min_weight": float(row["min_weight"]) if row.get("min_weight") else None,
|
|
305
|
+
"max_weight": float(row["max_weight"]) if row.get("max_weight") else None,
|
|
306
|
+
"max_length": float(row["max_length"]) if row.get("max_length") else None,
|
|
307
|
+
"max_width": float(row["max_width"]) if row.get("max_width") else None,
|
|
308
|
+
"max_height": float(row["max_height"]) if row.get("max_height") else None,
|
|
309
|
+
"weight_unit": "KG",
|
|
310
|
+
"dimension_unit": "CM",
|
|
311
|
+
"domicile": (row.get("domicile") or "").lower() == "true",
|
|
312
|
+
"international": True if (row.get("international") or "").lower() == "true" else None,
|
|
313
|
+
"zones": [],
|
|
314
|
+
}
|
|
315
|
+
country_codes = [c.strip() for c in row.get("country_codes", "").split(",") if c.strip()]
|
|
316
|
+
zone = models.ServiceZone(
|
|
317
|
+
label=row.get("zone_label", "Default Zone"),
|
|
318
|
+
rate=float(row.get("rate", 0.0)),
|
|
319
|
+
min_weight=float(row["min_weight"]) if row.get("min_weight") else None,
|
|
320
|
+
max_weight=float(row["max_weight"]) if row.get("max_weight") else None,
|
|
321
|
+
transit_days=int(row["transit_days"].split("-")[0]) if row.get("transit_days") and row["transit_days"].split("-")[0].isdigit() else None,
|
|
322
|
+
country_codes=country_codes if country_codes else None,
|
|
323
|
+
)
|
|
324
|
+
services_dict[karrio_service_code]["zones"].append(zone)
|
|
325
|
+
return [models.ServiceLevel(**service_data) for service_data in services_dict.values()]
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
DEFAULT_SERVICES = load_services_from_csv()
|
|
@@ -2,13 +2,13 @@ karrio/mappers/seko/__init__.py,sha256=Y7-x8XqXTaMapUnZkbwORggHLd6qPtTA4diRGKlMZ
|
|
|
2
2
|
karrio/mappers/seko/mapper.py,sha256=8pdGvnceOWWoDJtiazsZZ6iAAkAvbk6rs-QOvZ0xiVA,2430
|
|
3
3
|
karrio/mappers/seko/proxy.py,sha256=IvwK9SqaxDBX7ZamekHOn0KbucHrwK0Zcma2oA0QOx8,3294
|
|
4
4
|
karrio/mappers/seko/settings.py,sha256=iiOuwWh-I5FkNex4JyLvs9DmqNjFdWgu096cCTuceu8,491
|
|
5
|
-
karrio/plugins/seko/__init__.py,sha256=
|
|
5
|
+
karrio/plugins/seko/__init__.py,sha256=Z9SRp13HrWfwBxJLBldpUEdc-P4d1_q1JGRJ9Un6Mns,577
|
|
6
6
|
karrio/providers/seko/__init__.py,sha256=IzIUO4eo-TjsNmZeJ85u4yziUgnVu_uSg4dVct20e9U,527
|
|
7
7
|
karrio/providers/seko/error.py,sha256=MoyMQeVCUImTteJovs6NKsZ6t_zzuKD1AwIMJfGTFk4,3908
|
|
8
8
|
karrio/providers/seko/manifest.py,sha256=1r9yenrHGeQeOhacuHw4U28mE2cK0fanR-9pRKEH83w,1915
|
|
9
9
|
karrio/providers/seko/rate.py,sha256=w18hP7aWPFUdIpqGn8dZLOJXDR5YAMhhLOGdNwZZ6pY,6776
|
|
10
10
|
karrio/providers/seko/tracking.py,sha256=xWx_GTtOQYb-3ybA9doorsJeC1CVNJG91qIA4rzwISI,3856
|
|
11
|
-
karrio/providers/seko/units.py,sha256=
|
|
11
|
+
karrio/providers/seko/units.py,sha256=eifW5dsbg0uEGO92FAwOcwbf5MEQM2wwsBIYqBWUxwg,14676
|
|
12
12
|
karrio/providers/seko/utils.py,sha256=YWoDTiPqhsi77_NxrBs87fA5yY_O33jwdPiNPt4eoCs,3906
|
|
13
13
|
karrio/providers/seko/shipment/__init__.py,sha256=lmk_JKKObr83IAEeITBbVefCO-FeypZB8_jGIojIatA,225
|
|
14
14
|
karrio/providers/seko/shipment/cancel.py,sha256=O5VsuMidTRgpAikTIA5GbIbVSuIy0UCMk1LO3M9oLzk,1812
|
|
@@ -21,8 +21,8 @@ karrio/schemas/seko/rating_response.py,sha256=DZJgnP9YJWXy-mABPLD6YcdmE0Z4oVXosM
|
|
|
21
21
|
karrio/schemas/seko/shipping_request.py,sha256=P7vFsGB1IZDfH85mq8pv4qsIL5tYRGsAWWRJcryfv3U,5481
|
|
22
22
|
karrio/schemas/seko/shipping_response.py,sha256=a-cBMrZyUu9y5OOqgt7VWO7-LJ1mWVuZRWm7ygUY12I,5289
|
|
23
23
|
karrio/schemas/seko/tracking_response.py,sha256=vWhaKhWP4ZSor5cVZ2h8CvZMxE3h87e4tDXfPAgCsF4,702
|
|
24
|
-
karrio_seko-2026.1.
|
|
25
|
-
karrio_seko-2026.1.
|
|
26
|
-
karrio_seko-2026.1.
|
|
27
|
-
karrio_seko-2026.1.
|
|
28
|
-
karrio_seko-2026.1.
|
|
24
|
+
karrio_seko-2026.1.5.dist-info/METADATA,sha256=Gw_iauPhlL8BnltpixOfUYfXtJGRA2Wg99ykfzNfAV8,987
|
|
25
|
+
karrio_seko-2026.1.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
26
|
+
karrio_seko-2026.1.5.dist-info/entry_points.txt,sha256=38t4NWTw7ZuhE4-KYDHI3ZAN-PKrfduhrwTofZuhDxg,53
|
|
27
|
+
karrio_seko-2026.1.5.dist-info/top_level.txt,sha256=FZCY8Nwft8oEGHdl--xku8P3TrnOxu5dETEU_fWpRSM,20
|
|
28
|
+
karrio_seko-2026.1.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|