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:
- standalone —
ClientCredentialsProvider(OAuth2 client-credentials viarequests-oauthlib) orApiKeyProvider(DHL-style static key). - inside Frappe — a provider backed by the
Connected Appdoctype.
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
stubadapter — returns deterministic mock data; used for development and tests.usps/ups/fedex/dhl— interface seams in place; live API calls raiseCarrierNotImplementeduntil credentialed implementations land.
Layout
models.py—TrackingStatus,TrackingEvent,TrackingResultbase.py—CarrierAdapter(ABC) and theTokenProviderprotocolproviders.py— standalone token providers (api-key, client-credentials)registry.py—get_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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
032da226c64d1c8e3e1a3ce8c48366641a98f6b6e03d34eb549904f37c45c4bf
|
|
| MD5 |
6cebbb234c9240debacb9e9f0925e153
|
|
| BLAKE2b-256 |
d2afecc24fa93036b72915d1ff58fd810688ebba06c0aabbd7d0885d18d41d44
|
File details
Details for the file shipping_carriers-0.1.0-py3-none-any.whl.
File metadata
- Download URL: shipping_carriers-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1b8d7d2f7afff4e2dd85b33d0b8ef0c0e1582bd51fbf517f3531abc24e42c3a
|
|
| MD5 |
2893c9df58407b6731854e53e9233185
|
|
| BLAKE2b-256 |
bfdf0e207ecf8324de32ccb924c1a51ccfb8ee7ee63f99080bbc5e569737d15c
|