Registry / devops / pystrich

pystrich

JSON →
library0.14pypypi✓ verified 86d ago

PyStrich is a Python library for generating 1D and 2D barcodes including Code 39, Code 128, DataMatrix, QRCode, and EAN13. It is a fork of huBarcode. Version 0.14 requires Python >=3.10. The library has limited maintenance activity.

pip install pystrich
INSTALL
IMPORT
SIG · PYSTRICH
P
pystrich
devopspythonv0.14
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Code39Encoder
from pystrich.code39 import Code39Encoder
Code128Encoder
from pystrich.code128 import Code128Encoder
EAN13Encoder
from pystrich.ean13 import EAN13Encoder
DatamatrixEncoder
from pystrich.datamatrix import DatamatrixEncoder
QRCodeEncoder
from pystrich.qrcode import QRCodeEncoder

Generate a Code 128 barcode and save as PNG.

from pystrich.code128 import Code128Encoder encoder = Code128Encoder('Hello World') encoder.save('barcode.png')
Debug
Known issues
gotchaQRCodeEncoder generates DataMatrix-like codes, not standard QR codes. For actual QR codes, use a different library like qrcode.
fix
Use qrcode library for QR codes.
affects: all
gotchaThe library does not return PIL images or bytes; only saves to file. To get image data, save to a BytesIO object.
fix
Use io.BytesIO() as file-like object: from io import BytesIO; buf = BytesIO(); encoder.save(buf)
affects: all
deprecatedPython 3.9 and below are no longer supported since version 0.14.
fix
Use Python >=3.10 or pin to last compatible version for older Python.
affects: >=0.14
Errors
Common errors & fixes
ImportError: No module named 'pystrich'
The package is not installed.
fix
Run: pip install pystrich
AttributeError: module 'pystrich.qrcode' has no attribute 'QRCodeEncoder'
Wrong import path. The QRCode encoder is not always available or named differently.
fix
Check the library version; if using pystrich, import from pystrich.datamatrix for DataMatrix, not QRCodeEncoder.
Upgrade
Version history
0.14latest on PyPI · released May 18, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
pystrich — pip install pystrich · libregistry