Skip to main content

A simple package for determining shipping carriers and generating tracking URLs.

Project description

trackj

A simple Python library for determining shipping carriers and generating tracking URLs from tracking numbers. Supports multiple carriers with regex-based detection.

Installation

pip install trackj

Or using Poetry:

poetry add trackj

Usage

Import the trackj module and use the available functions to match carriers, generate URLs, or get carrier IDs.

import trackj

# Match a tracking number to a carrier and URL
result = trackj.match("1Z999AA10123456784")
print(result)  # {'carrier': 'ups', 'url': 'http://wwwapps.ups.com/...'}

# Get only the tracking URL
url = trackj.url("1Z999AA10123456784")
print(url)  # 'http://wwwapps.ups.com/...'

# Get only the carrier ID
carrier = trackj.carrier("1Z999AA10123456784")
print(carrier)  # 'ups'

# Access the full mapping of carriers, regex patterns, and URLs
print(trackj.MAP)

Supported Carriers

  • UPS
  • FedEx
  • USPS
  • DHL
  • Canada Post
  • Royal Mail
  • Australia Post
  • China Post
  • Japan Post
  • Hermes UK
  • GLS
  • PostNL
  • Correos Spain
  • Deutsche Post
  • Aramex
  • SF Express

License

MIT License

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

trackj-0.1.0.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

trackj-0.1.0-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

Supported by

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