# <a href="https://karrio.io" target="_blank"><img alt="Karrio" src="https://docs.karrio.io/img/logo.svg" height="50px" /></a>
[](https://github.com/karrioapi/karrio/actions/workflows/tests.yml)
[](./LICENSE)
[](https://www.codacy.com/gh/karrio/karrio/dashboard?utm_source=github.com&utm_medium=referral&utm_content=karrio/karrio&utm_campaign=Badge_Grade)
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.7+
## Installation
```bash
# install karrio core
pip install karrio
# eg: install the karrio canadapost extention
pip install karrio.canadapost
```
<details>
<summary>Additional carrier extensions</summary>
- `karrio.aramex`
- `karrio.australiapost`
- `karrio.canadapost`
- `karrio.canpar`
- `karrio.dhl-express`
- `karrio.dhl-universal`
- `karrio.dicom`
- `karrio.fedex`
- `karrio.purolator`
- `karrio.royalmail`
- `karrio.sendle`
- `karrio.sf-express`
- `karrio.tnt`
- `karrio.ups`
- `karrio.usps`
- `karrio.usps-international`
- `karrio.yanwen`
- `karrio.yunexpress`
</details>
## Usage
<details>
<summary>Rates Fetching</summary>
- Fetch shipping rates
```python
import 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,
# )
# ]
```
</details>
## Resources
- [**Documentation**](https://docs.karrio.io)
- [**Community Discussions**](https://github.com/karrioapi/karrio/discussions)
- [**Issue Tracker**](https://github.com/karrioapi/karrio/issues)
- [**Blog**](https://docs.karrio.io/blog)
> [Join us on Discord](https://discord.gg/gS88uE7sEx)
Raw data
{
"_id": null,
"home_page": "https://github.com/karrioapi/karrio",
"name": "karrio",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "karrio",
"author_email": "hello@karrio.io",
"download_url": "",
"platform": null,
"description": "# <a href=\"https://karrio.io\" target=\"_blank\"><img alt=\"Karrio\" src=\"https://docs.karrio.io/img/logo.svg\" height=\"50px\" /></a>\n\n[](https://github.com/karrioapi/karrio/actions/workflows/tests.yml)\n[](./LICENSE)\n[](https://www.codacy.com/gh/karrio/karrio/dashboard?utm_source=github.com&utm_medium=referral&utm_content=karrio/karrio&utm_campaign=Badge_Grade)\n\nkarrio is a multi-carrier shipping SDK.\n\nThe key features are:\n\n- **Unified API**: A standardized set of models representing the common shipping data (`Address`, `Parcel`, `Shipment`...)\n- **Intuitive API**: A library that abstracts and unifies the typical shipping API services (`Rating`, `Shipping`, `Tracking`...)\n- **Multi-carrier**: Integrate karrio once and connect to multiple shipping carrier APIs\n- **Custom carrier**: A framework to integrate a shipping carrier services within hours instead of months\n\n## Requirements\n\nPython 3.7+\n\n## Installation\n\n```bash\n# install karrio core\npip install karrio\n\n# eg: install the karrio canadapost extention\npip install karrio.canadapost\n```\n\n<details>\n<summary>Additional carrier extensions</summary>\n\n- `karrio.aramex`\n- `karrio.australiapost`\n- `karrio.canadapost`\n- `karrio.canpar`\n- `karrio.dhl-express`\n- `karrio.dhl-universal`\n- `karrio.dicom`\n- `karrio.fedex`\n- `karrio.purolator`\n- `karrio.royalmail`\n- `karrio.sendle`\n- `karrio.sf-express`\n- `karrio.tnt`\n- `karrio.ups`\n- `karrio.usps`\n- `karrio.usps-international`\n- `karrio.yanwen`\n- `karrio.yunexpress`\n\n</details>\n\n## Usage\n\n<details>\n<summary>Rates Fetching</summary>\n\n- Fetch shipping rates\n\n```python\nimport karrio\nfrom karrio.core.models import Address, Parcel, RateRequest\nfrom karrio.mappers.canadapost.settings import Settings\n\n\n# Initialize a carrier gateway\ncanadapost = karrio.gateway[\"canadapost\"].create(\n Settings(\n username=\"6e93d53968881714\",\n password=\"0bfa9fcb9853d1f51ee57a\",\n customer_number=\"2004381\",\n contract_id=\"42708517\",\n test=True\n )\n)\n\n# Fetching shipment rates\n\n# Provide the shipper's address\nshipper = Address(\n postal_code=\"V6M2V9\",\n city=\"Vancouver\",\n country_code=\"CA\",\n state_code=\"BC\",\n address_line1=\"5840 Oak St\"\n)\n\n# Provide the recipient's address\nrecipient = Address(\n postal_code=\"E1C4Z8\",\n city=\"Moncton\",\n country_code=\"CA\",\n state_code=\"NB\",\n residential=False,\n address_line1=\"125 Church St\"\n)\n\n# Specify your package dimensions and weight\nparcel = Parcel(\n height=3.0,\n length=6.0,\n width=3.0,\n weight=0.5,\n weight_unit='KG',\n dimension_unit='CM'\n)\n\n# Prepare a rate request\nrate_request = RateRequest(\n shipper=shipper,\n recipient=recipient,\n parcels=[parcel],\n services=[\"canadapost_xpresspost\"],\n)\n\n# Send a rate request using a carrier gateway\nresponse = karrio.Rating.fetch(rate_request).from_(canadapost)\n\n# Parse the returned response\nrates, messages = response.parse()\n\nprint(rates)\n# [\n# RateDetails(\n# carrier_name=\"canadapost\",\n# carrier_id=\"canadapost\",\n# currency=\"CAD\",\n# transit_days=2,\n# service=\"canadapost_xpresspost\",\n# discount=1.38,\n# base_charge=12.26,\n# total_charge=13.64,\n# duties_and_taxes=0.0,\n# extra_charges=[\n# ChargeDetails(name=\"Automation discount\", amount=-0.37, currency=\"CAD\"),\n# ChargeDetails(name=\"Fuel surcharge\", amount=1.75, currency=\"CAD\"),\n# ],\n# meta=None,\n# id=None,\n# )\n# ]\n```\n\n</details>\n\n## Resources\n\n- [**Documentation**](https://docs.karrio.io)\n- [**Community Discussions**](https://github.com/karrioapi/karrio/discussions)\n- [**Issue Tracker**](https://github.com/karrioapi/karrio/issues)\n- [**Blog**](https://docs.karrio.io/blog)\n\n> [Join us on Discord](https://discord.gg/gS88uE7sEx)\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Multi-carrier shipping API integration with python",
"version": "2023.9.2",
"project_urls": {
"Homepage": "https://github.com/karrioapi/karrio"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "39476989042b1567513e7995d891dc7de9d8b2b8cde3d5bae2b8ba194bb5c7e5",
"md5": "6cf5f01c39acce4c582734461347d08c",
"sha256": "8b2abbb0d43e63d5bb2a7266edd62725ffb8573d521f75b2c55ca72781e3e277"
},
"downloads": -1,
"filename": "karrio-2023.9.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6cf5f01c39acce4c582734461347d08c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 158942,
"upload_time": "2023-12-08T05:08:52",
"upload_time_iso_8601": "2023-12-08T05:08:52.992067Z",
"url": "https://files.pythonhosted.org/packages/39/47/6989042b1567513e7995d891dc7de9d8b2b8cde3d5bae2b8ba194bb5c7e5/karrio-2023.9.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-08 05:08:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "karrioapi",
"github_project": "karrio",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [
{
"name": "asgiref",
"specs": [
[
"==",
"3.9.1"
]
]
},
{
"name": "attrs",
"specs": [
[
"==",
"25.3.0"
]
]
},
{
"name": "backoff",
"specs": [
[
"==",
"2.2.1"
]
]
},
{
"name": "Brotli",
"specs": [
[
"==",
"1.1.0"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2025.7.14"
]
]
},
{
"name": "cffi",
"specs": [
[
"==",
"1.17.1"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.4.2"
]
]
},
{
"name": "click",
"specs": [
[
"==",
"8.2.1"
]
]
},
{
"name": "cryptography",
"specs": [
[
"==",
"45.0.5"
]
]
},
{
"name": "cssselect2",
"specs": [
[
"==",
"0.8.0"
]
]
},
{
"name": "deprecation",
"specs": [
[
"==",
"2.1.0"
]
]
},
{
"name": "diff-match-patch",
"specs": [
[
"==",
"20241021"
]
]
},
{
"name": "distro",
"specs": [
[
"==",
"1.9.0"
]
]
},
{
"name": "dj-database-url",
"specs": [
[
"==",
"3.0.1"
]
]
},
{
"name": "Django",
"specs": [
[
"==",
"5.2.4"
]
]
},
{
"name": "django-constance",
"specs": [
[
"==",
"4.3.2"
]
]
},
{
"name": "django-cors-headers",
"specs": [
[
"==",
"4.7.0"
]
]
},
{
"name": "django-downloadview",
"specs": [
[
"==",
"2.4.0"
]
]
},
{
"name": "django-email-verification",
"specs": [
[
"==",
"0.3.3"
]
]
},
{
"name": "django-filter",
"specs": [
[
"==",
"25.1"
]
]
},
{
"name": "django-formtools",
"specs": [
[
"==",
"2.5.1"
]
]
},
{
"name": "django-health-check",
"specs": [
[
"==",
"3.20.0"
]
]
},
{
"name": "django-import-export",
"specs": [
[
"==",
"4.3.9"
]
]
},
{
"name": "django-oauth-toolkit",
"specs": [
[
"==",
"3.0.1"
]
]
},
{
"name": "django-otp",
"specs": [
[
"==",
"1.6.1"
]
]
},
{
"name": "django-phonenumber-field",
"specs": [
[
"==",
"8.1.0"
]
]
},
{
"name": "django-picklefield",
"specs": [
[
"==",
"3.3"
]
]
},
{
"name": "django-redis",
"specs": [
[
"==",
"6.0.0"
]
]
},
{
"name": "django-two-factor-auth",
"specs": [
[
"==",
"1.17.0"
]
]
},
{
"name": "djangorestframework",
"specs": [
[
"==",
"3.16.0"
]
]
},
{
"name": "djangorestframework_simplejwt",
"specs": [
[
"==",
"5.5.1"
]
]
},
{
"name": "drf-api-tracking",
"specs": [
[
"==",
"1.8.4"
]
]
},
{
"name": "drf-spectacular",
"specs": [
[
"==",
"0.28.0"
]
]
},
{
"name": "fonttools",
"specs": [
[
"==",
"4.59.0"
]
]
},
{
"name": "graphql-core",
"specs": [
[
"==",
"3.2.6"
]
]
},
{
"name": "gunicorn",
"specs": [
[
"==",
"23.0.0"
]
]
},
{
"name": "h11",
"specs": [
[
"==",
"0.16.0"
]
]
},
{
"name": "hiredis",
"specs": [
[
"==",
"3.2.1"
]
]
},
{
"name": "huey",
"specs": [
[
"==",
"2.5.3"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.10"
]
]
},
{
"name": "inflection",
"specs": [
[
"==",
"0.5.1"
]
]
},
{
"name": "Jinja2",
"specs": [
[
"==",
"3.1.6"
]
]
},
{
"name": "jsonfield",
"specs": [
[
"==",
"3.2.0"
]
]
},
{
"name": "jsonschema",
"specs": [
[
"==",
"4.25.0"
]
]
},
{
"name": "jsonschema-specifications",
"specs": [
[
"==",
"2025.4.1"
]
]
},
{
"name": "jstruct",
"specs": [
[
"==",
"2021.11"
]
]
},
{
"name": "jwcrypto",
"specs": [
[
"==",
"1.5.6"
]
]
},
{
"name": "karrio",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-australiapost",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-canadapost",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-chronopost",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-dhl-express",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-dhl-parcel-de",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-dhl-poland",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-dhl-universal",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-dpd",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-easypost",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-easyship",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-eshipper",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-fedex",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-freightcom",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-generic",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-laposte",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-purolator",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-sapient",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-seko",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-sendle",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-server",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-server-core",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-server-data",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-server-documents",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-server-events",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-server-graph",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-server-manager",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-server-orders",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-server-pricing",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-server-proxy",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-ups",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-usps",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "karrio-usps-international",
"specs": [
[
"==",
"2025.5rc8"
]
]
},
{
"name": "lxml",
"specs": [
[
"==",
"4.9.4"
]
]
},
{
"name": "lxml-stubs",
"specs": [
[
"==",
"0.5.1"
]
]
},
{
"name": "MarkupSafe",
"specs": [
[
"==",
"3.0.2"
]
]
},
{
"name": "more-itertools",
"specs": [
[
"==",
"10.7.0"
]
]
},
{
"name": "oauthlib",
"specs": [
[
"==",
"3.3.1"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"25.0"
]
]
},
{
"name": "phonenumbers",
"specs": [
[
"==",
"9.0.10"
]
]
},
{
"name": "pillow",
"specs": [
[
"==",
"11.3.0"
]
]
},
{
"name": "posthog",
"specs": [
[
"==",
"6.3.1"
]
]
},
{
"name": "psutil",
"specs": [
[
"==",
"7.0.0"
]
]
},
{
"name": "psycopg2-binary",
"specs": [
[
"==",
"2.9.10"
]
]
},
{
"name": "py-soap",
"specs": [
[
"==",
"2020.3.2"
]
]
},
{
"name": "pycparser",
"specs": [
[
"==",
"2.22"
]
]
},
{
"name": "pydyf",
"specs": [
[
"==",
"0.11.0"
]
]
},
{
"name": "PyJWT",
"specs": [
[
"==",
"2.10.1"
]
]
},
{
"name": "PyPDF2",
"specs": [
[
"==",
"3.0.1"
]
]
},
{
"name": "pyphen",
"specs": [
[
"==",
"0.17.2"
]
]
},
{
"name": "pypng",
"specs": [
[
"==",
"0.20220715.0"
]
]
},
{
"name": "python-barcode",
"specs": [
[
"==",
"0.15.1"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.9.0.post0"
]
]
},
{
"name": "python-decouple",
"specs": [
[
"==",
"3.8"
]
]
},
{
"name": "pytz",
"specs": [
[
"==",
"2025.2"
]
]
},
{
"name": "PyYAML",
"specs": [
[
"==",
"6.0.2"
]
]
},
{
"name": "pyzint",
"specs": [
[
"==",
"0.1.10"
]
]
},
{
"name": "qrcode",
"specs": [
[
"==",
"7.4.2"
]
]
},
{
"name": "redis",
"specs": [
[
"==",
"6.2.0"
]
]
},
{
"name": "referencing",
"specs": [
[
"==",
"0.36.2"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.4"
]
]
},
{
"name": "rpds-py",
"specs": [
[
"==",
"0.26.0"
]
]
},
{
"name": "sentry-sdk",
"specs": [
[
"==",
"2.33.2"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.17.0"
]
]
},
{
"name": "sqlparse",
"specs": [
[
"==",
"0.5.3"
]
]
},
{
"name": "strawberry-graphql",
"specs": [
[
"==",
"0.278.0"
]
]
},
{
"name": "tablib",
"specs": [
[
"==",
"3.8.0"
]
]
},
{
"name": "tinycss2",
"specs": [
[
"==",
"1.4.0"
]
]
},
{
"name": "tinyhtml5",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "toml",
"specs": [
[
"==",
"0.10.2"
]
]
},
{
"name": "typing_extensions",
"specs": [
[
"==",
"4.14.1"
]
]
},
{
"name": "uritemplate",
"specs": [
[
"==",
"4.2.0"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.5.0"
]
]
},
{
"name": "uvicorn",
"specs": [
[
"==",
"0.35.0"
]
]
},
{
"name": "validators",
"specs": [
[
"==",
"0.35.0"
]
]
},
{
"name": "weasyprint",
"specs": [
[
"==",
"66.0"
]
]
},
{
"name": "webencodings",
"specs": [
[
"==",
"0.5.1"
]
]
},
{
"name": "whitenoise",
"specs": [
[
"==",
"6.9.0"
]
]
},
{
"name": "xmltodict",
"specs": [
[
"==",
"0.14.2"
]
]
},
{
"name": "zopfli",
"specs": [
[
"==",
"0.2.3.post1"
]
]
}
],
"lcname": "karrio"
}