Skip to main content

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.

Release files for genbarcode 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for genbarcode 1.0.1
File Size Uploaded
genBarcode-1.0.1.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for genbarcode 1.0.1
File Interpreter ABI Platform
genBarcode-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.3 kB

Release files / genBarcode-1.0.1.tar.gz

Download URL genBarcode-1.0.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c3cb483b81f107b048c52ff4ed727c631efe163c3490384f913e79d25d9fd0d7
BLAKE2b-256 checksum
How to use checksums
526f33f9bcd3ba72d346e53bf5a322cf7f261d3c1f0d7527db4403d8ff40c450
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.10 CPython/3.9.6 Windows/10

Release files / genBarcode-1.0.1-py3-none-any.whl

Download URL genBarcode-1.0.1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a57ce215e8d228cfa8afb274d8d9d2498169340e7088d90456ebf431b3b3c03b
BLAKE2b-256 checksum
How to use checksums
4e5c43e90d8ba872f646ca1f6266b332db191c2cb3379eda7432354e89d73b12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.10 CPython/3.9.6 Windows/10

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.0.1

2 release 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