Skip to main content

offline tracking number image rendering tool.

Project description

genBarcode

genBarcode is a cli tool I created to simply take a string and generate barcode.

I use an application on my phone to track numerous packages. When I get the tracking on my phone it's relatively easy to just add the tracking directly. But when it's on my computer I tend to copy the tracking number and paste it into one of the many online barcode generator sites. Sometimes these sites don't make the barcode big enough, or they use some different barcode that my phone has trouble reading.

I figureed I'd just create a python tool to generate the barcode for me. This makes it so I don't have to rely on sites, or dealing with the hassle. The code uses python-barcode and supports the full gambit of formats offered by that library.

Additionally this just a fun project to improve my skills such as

  • learning more about packaging python tools
  • building wheels
  • uploading to pypi
  • building a reliable development environment
  • using poetry
  • using pipx

Installation

I highly recommend you use pipx to install this, as it creates the virtualenv for you and seamlessly handles the loading of the virtual environment when running this tool. If you choose not to use pipx, you should create a virtualenv and possibly a wrapper script to launch this in the virtualenv.

pipx install genBarcode

Usage

The following is the help for the program

usage: genbarcode [-h] [-V] [-v] [-l] [-m METHOD] [-d DATA] [-t TRACKING]

 program description to be displayed by argparse
    ex: python genBarcode.py


optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -v, --verbose
  -l, --list-methods    Enumerate available generators and exit
  -m METHOD, --method METHOD
                        set the barcode generated type (default: code128)
  -d DATA, --data DATA  Provide data to be used to generate the barcode
  -t TRACKING, --tracking TRACKING
                        Provide tracking number to be used to generate the barcode, stub for --data

One of -d or -t is required. You can use either one.

Examples

# print help/usage
genBarcode -h

# print all available barcode formats
genBarcode -l

# print all available barcode formats
genBarcode -l

# USPS sample
genBarcode -d 9400123456789999876500

# UPS sample
genBarcode --data 1Z9999999999999999

# Fedex sample
genBarcode --tracking 123456789012

# Generate isbn for 1984/George.Orwell
genBarcode -m isbn -d 9780451524935
genBarcode -m isbn13 -d 9780451524935
genBarcode -m isbn10 -d 0451524934

Credits

This package was created with Cookiecutter and the tbennett6421/pythoncookie project template.

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

genBarcode-1.0.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

genBarcode-1.0.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file genBarcode-1.0.1.tar.gz.

File metadata

  • Download URL: genBarcode-1.0.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.9.6 Windows/10

File hashes

Hashes for genBarcode-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c3cb483b81f107b048c52ff4ed727c631efe163c3490384f913e79d25d9fd0d7
MD5 f0ce73df8a8236f134daa1e23e38e806
BLAKE2b-256 526f33f9bcd3ba72d346e53bf5a322cf7f261d3c1f0d7527db4403d8ff40c450

See more details on using hashes here.

File details

Details for the file genBarcode-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: genBarcode-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.9.6 Windows/10

File hashes

Hashes for genBarcode-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a57ce215e8d228cfa8afb274d8d9d2498169340e7088d90456ebf431b3b3c03b
MD5 31a3933ff5e37ce87593617abcb8dc87
BLAKE2b-256 4e5c43e90d8ba872f646ca1f6266b332db191c2cb3379eda7432354e89d73b12

See more details on using hashes here.

Supported by

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