Skip to main content

shipping-carriers

Framework-agnostic multi-carrier shipment tracking for USPS, UPS, FedEx and DHL, with a common normalized result model. Pricing and labels may follow.

It has no dependency on Frappe (or any web framework). Authentication is injected via a small TokenProvider seam, so the same adapters work:

  • standaloneClientCredentialsProvider (OAuth2 client-credentials via requests-oauthlib) or ApiKeyProvider (DHL-style static key).
  • inside Frappe — a provider backed by the Connected App doctype.

OAuth handling is delegated to requests-oauthlib, not reimplemented. Any object with auth_headers() -> dict works, so you can supply your own.

from shipping_carriers.registry import get_adapter
from shipping_carriers.providers import ClientCredentialsProvider

adapter = get_adapter(
    "fedex",
    token_provider=ClientCredentialsProvider(
        token_uri="https://apis.fedex.com/oauth/token",
        client_id="...", client_secret="...",
    ),
)
result = adapter.track("123456789012")
print(result.status, result.delivered_at)
for ev in result.events:
    print(ev.time, ev.status, ev.description, ev.location)

Status

  • stub adapter — returns deterministic mock data; used for development and tests.
  • usps / ups / fedex / dhl — interface seams in place; live API calls raise CarrierNotImplemented until credentialed implementations land.

Layout

  • models.pyTrackingStatus, TrackingEvent, TrackingResult
  • base.pyCarrierAdapter (ABC) and the TokenProvider protocol
  • providers.py — standalone token providers (api-key, client-credentials)
  • registry.pyget_adapter(provider, token_provider=..., **opts)
  • adapters/ — one module per carrier

Download files

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

Source Distribution

shipping_carriers-0.1.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

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

shipping_carriers-0.1.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file shipping_carriers-0.1.0.tar.gz.

File metadata

  • Download URL: shipping_carriers-0.1.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.2

File hashes

Hashes for shipping_carriers-0.1.0.tar.gz
Algorithm Hash digest
SHA256 032da226c64d1c8e3e1a3ce8c48366641a98f6b6e03d34eb549904f37c45c4bf
MD5 6cebbb234c9240debacb9e9f0925e153
BLAKE2b-256 d2afecc24fa93036b72915d1ff58fd810688ebba06c0aabbd7d0885d18d41d44

See more details on using hashes here.

File details

Details for the file shipping_carriers-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for shipping_carriers-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1b8d7d2f7afff4e2dd85b33d0b8ef0c0e1582bd51fbf517f3531abc24e42c3a
MD5 2893c9df58407b6731854e53e9233185
BLAKE2b-256 bfdf0e207ecf8324de32ccb924c1a51ccfb8ee7ee63f99080bbc5e569737d15c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page