skillfed

pdf417gen

PDF417 2D barcode generator for Python

pdf417gen v0.8.1 108.9K downloads/30d#12,535 on PyPI101
Permissive license PDF417-Py License Copyright (c) 2016 Ivan Habunek <ivan.habunek@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation… (full text in the JSON record) AGING released

What it is and what it does

pdf417gen is a Python library for generating PDF417 2D barcodes—a stacked linear barcode format commonly used in identification documents, shipping labels, and data capture applications. It takes text or binary input, encodes it into a list of code words using the PDF417 algorithm, and renders the result as either a Pillow Image object or an SVG document. The encoding process supports customization via column count (1–30, default 6) and security level (0–8, controlling error correction strength), and the rendering functions offer control over scale, aspect ratio, padding, and colors.

The package is straightforward to use: call encode() with your data, then pass the result to either render_image() or render_svg(). It handles Unicode input (UTF-8 by default) and offers a command-line interface for quick barcode generation. The single runtime dependency is Pillow, making installation and deployment lightweight. The codebase is stable and aging, with recent maintenance activity.

Use it for:

  • Generate barcodes for shipping labels, inventory tracking, or document identification in e-commerce or logistics workflows.
  • Encode structured data (IDs, URLs, contact info) into 2D barcodes for mobile scanning or archival systems.
  • Create custom barcode images with branded colors and sizing for printed materials or labels.
  • Build a CLI tool or batch process to convert text files or CSV records into barcode images.
  • Embed barcode generation in a web application to produce downloadable or on-demand barcode images.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Encodes text and binary data into PDF417 2D barcodes and renders them as images or SVG files.

Yes. The package is lightweight, well-licensed, and solves a specific problem with low friction. It has no known vulnerabilities, a single stable dependency, and active maintenance. Install it if you need to generate PDF417 barcodes; the API is simple and the output formats cover most use cases.

Install

pdf417gen on PyPI

pip

pip install pdf417gen

uv

uv add pdf417gen

poetry

poetry add pdf417gen

Installing pdf417gen

Before you install

Low install friction with a single runtime dependency. The package is aging but actively maintained, with a recent commit in May 2025.

License in practice

Licensed under MIT (permissive), allowing free use, modification, and distribution with minimal restrictions.

Quickstart

pip install pdf417gen

from pdf417gen import encode, render_image

codes = encode("Hello World")
image = render_image(codes)
image.save('barcode.png')

Requires Python 3.8 or later; Pillow must be installed for image rendering.

Verify before relying

  • Whether the CLI tool (pdf417gen encode) is documented or tested for production use.
  • Performance characteristics when encoding very large data sets or generating many barcodes.
  • Compatibility with modern versions of Pillow and any known rendering quirks.

Package facts

License PDF417-Py License Copyright (c) 2016 Ivan Habunek <ivan.habunek@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — Pillow
Maintenance aging — 568 days since the last release
Last repo commit
First released
Downloads 108,865/month — #12,535 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pdf417gen-0.8.1-py3-none-any.whl

Keywords: pdf417, 2d, barcode, generator

Environment :: ConsoleLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

pdf417 barcode generator2d barcode encodingbarcode image generationpdf417 python libraryencode data to barcodebarcode svg rendering2d barcode python
barcode-generation2d-encoding

More Utilities packages