karrio is a multi-carrier shipping SDK.
The key features are:
- Unified API: A standardized set of models representing the common shipping data (
Address,Parcel,Shipment...) - Intuitive API: A library that abstracts and unifies the typical shipping API services (
Rating,Shipping,Tracking...) - Multi-carrier: Integrate karrio once and connect to multiple shipping carrier APIs
- Custom carrier: A framework to integrate a shipping carrier services within hours instead of months
Requirements
Python 3.11+
Installation
# install karrio core
pip install karrio
# eg: install the karrio canadapost extention
pip install karrio.canadapost
Additional carrier extensions
karrio.aramexkarrio.australiapostkarrio.canadapostkarrio.canparkarrio.dhl-expresskarrio.dhl-universalkarrio.dicomkarrio.fedexkarrio.purolatorkarrio.royalmailkarrio.sendlekarrio.sf-expresskarrio.tntkarrio.upskarrio.uspskarrio.usps-internationalkarrio.yanwenkarrio.yunexpress
Usage
Rates Fetching
- Fetch shipping rates
import karrio.sdk as karrio
from karrio.core.models import Address, Parcel, RateRequest
from karrio.mappers.canadapost.settings import Settings
# Initialize a carrier gateway
canadapost = karrio.gateway["canadapost"].create(
Settings(
username="6e93d53968881714",
password="0bfa9fcb9853d1f51ee57a",
customer_number="2004381",
contract_id="42708517",
test=True
)
)
# Fetching shipment rates
# Provide the shipper's address
shipper = Address(
postal_code="V6M2V9",
city="Vancouver",
country_code="CA",
state_code="BC",
address_line1="5840 Oak St"
)
# Provide the recipient's address
recipient = Address(
postal_code="E1C4Z8",
city="Moncton",
country_code="CA",
state_code="NB",
residential=False,
address_line1="125 Church St"
)
# Specify your package dimensions and weight
parcel = Parcel(
height=3.0,
length=6.0,
width=3.0,
weight=0.5,
weight_unit='KG',
dimension_unit='CM'
)
# Prepare a rate request
rate_request = RateRequest(
shipper=shipper,
recipient=recipient,
parcels=[parcel],
services=["canadapost_xpresspost"],
)
# Send a rate request using a carrier gateway
response = karrio.Rating.fetch(rate_request).from_(canadapost)
# Parse the returned response
rates, messages = response.parse()
print(rates)
# [
# RateDetails(
# carrier_name="canadapost",
# carrier_id="canadapost",
# currency="CAD",
# transit_days=2,
# service="canadapost_xpresspost",
# discount=1.38,
# base_charge=12.26,
# total_charge=13.64,
# duties_and_taxes=0.0,
# extra_charges=[
# ChargeDetails(name="Automation discount", amount=-0.37, currency="CAD"),
# ChargeDetails(name="Fuel surcharge", amount=1.75, currency="CAD"),
# ],
# meta=None,
# id=None,
# )
# ]
Resources
Metadata
Release files for karrio 2026.1.32
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| karrio-2026.1.32-py3-none-any.whl | Python 3 | none | any | Details |
Release files / karrio-2026.1.32-py3-none-any.whl
| Download URL | karrio-2026.1.32-py3-none-any.whl |
|---|---|
| Size | 215.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf4b64316508edb25203aeb127406a2cd126667b3a870c461e3f2c6cbdd323a8
|
|
BLAKE2b-256 checksum How to use checksums |
8d53963c6b8f4e93b8fc58867d09e86dea8cdad03f6dca06b9d8976b9f2ffd4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|