This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Identify shippers and valid tracking numbers from package barcodes.

A package barcode string is tested against known shipper barcode types, matching the format and calculating checksum validity to identify the type provided. The module supports these barcode formats:

  • DHL
  • FedEx Express
  • FedEx Ground “96”
  • OnTrac
  • UPS
  • USPS IMpb
  • USPS UPU S10
  • USPS 20

Note: For some shippers the package barcode is the same as the tracking number, while for others the tracking number is a subset of the barcode. Inputting a tracking number instead of a barcode will work in some cases but not others.

Usage

Begin by importing the Drogher module:

>>> import drogher

Now, call the barcode function with a package barcode string:

>>> package = drogher.barcode('1Z999AA10123456784')

That returns a Package subclass containing some useful information:

>>> package.barcode
'1Z999AA10123456784'
>>> package.shipper
'UPS'
>>> package.tracking_number
'1Z999AA10123456784'

We can also ensure the package is valid, which tells us the barcode matched an expected format and the calculated checksum matches the check digit:

>>> package.is_valid
True

If a barcode cannot be matched with a shipper, the class does not validate and the shipper is None:

>>> package = drogher.barcode('123456')
>>> package.is_valid
False
>>> package.shipper
None

For some shippers, the barcode is not the same as the tracking number:

>>> package = drogher.barcode('420221539101026837331000039521')
>>> package.barcode
'420221539101026837331000039521'
>>> package.tracking_number
'9101026837331000039521'
>>> package.shipper
'USPS'

Changelog

Version 0.0.2

  • Improved pattern match for USPS IMpb barcodes
  • Added support for 20 character USPS barcodes

Version 0.0.1

  • Initial release
Release History

Release History

0.0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
drogher-0.0.2-py2.py3-none-any.whl (21.1 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Jul 13, 2016
drogher-0.0.2.tar.gz (5.7 kB) Copy SHA256 Checksum SHA256 Source Jul 13, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting