Skip to main content

Official Python SDK for the Serian Logistics shipping API

Project description

serianlogistics

Official Python SDK for the Serian Logistics shipping API.
Minimal, zero-dependency (stdlib only).

Install

pip install serianlogistics

Requires Python 3.9+.

Quick Start

from serianlogistics import SerianLogistics

sl = SerianLogistics(api_key="sk_live_xxx")

# 1. Get rates
result = sl.rates.list(
    shipper={"name": "Acme", "street1": "1 Main", "city": "Accra",
             "state": "GA", "zip": "00233", "country": "GH"},
    recipient={"name": "Jane", "street1": "1 Oak", "city": "Lagos",
               "state": "LA", "zip": "100001", "country": "NG"},
    parcels=[{"length": 20, "width": 15, "height": 10, "weight": 1,
              "dimension_unit": "CM", "weight_unit": "KG"}],
)

# 2. Create a shipment
shipment = sl.shipments.create(
    {"rate_id": result["rates"][0]["rate_id"], "reference": "order-123"},
    idempotency_key="order-123",
)

print(shipment["tracking_number"], shipment["label_url"])

Configuration

Parameter Type Default Description
api_key str Your Serian API key (required)
base_url str https://api.serianlogistics.com API base URL
retries int 3 Auto-retry on 429/5xx with backoff

Error Handling

from serianlogistics import SerianLogistics, SerianLogisticsError

try:
    sl.shipments.create(payload)
except SerianLogisticsError as e:
    print(e.status, e.code, e.request_id)

License

MIT — Full API reference at https://serianlogistics.com/docs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

serianlogistics-0.2.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

serianlogistics-0.2.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file serianlogistics-0.2.0.tar.gz.

File metadata

  • Download URL: serianlogistics-0.2.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for serianlogistics-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b298ec95e51aa0df969dd0078eb30a0ac047e042f3806e318effae2989a64c0c
MD5 c564a7f7263a727a629a368abb7ca248
BLAKE2b-256 e0a3fde04ec51d4248f68146f43fc90b75d68d33902cdaaeb0ef2fc090290b22

See more details on using hashes here.

File details

Details for the file serianlogistics-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for serianlogistics-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9499e55b2e655a6f023182061c1e1e86e530fb4d88033dcaefccc87c27fb86c3
MD5 7b9f5fd7567d72309765b6f030470327
BLAKE2b-256 b7adad3729348b13e30bd0ff59a093b4998d08e0faa1d1d4d8b5a4972252bf23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page