Pylibdmtx
lastmod 2024-09-23created 2024-09-233 edits
Read and write Data Matrix barcodes from Python 2 and 3.
Install
Additional installation on Ubuntu-based systems:
If the following error is printed:
However the following packages replace it:
libdmtx0b
E: Package 'libdmtx0a' has no installation candidate
Install that package instead:
Example usage
The decode function accepts instances of PIL.Image.
>>> from pylibdmtx.pylibdmtx import decode
>>> from PIL import Image
>>> decode(Image.open('pylibdmtx/tests/datamatrix.png'))
[Decoded(data='Stegosaurus', rect=Rect(left=5, top=6, width=96, height=95)),
Decoded(data='Plesiosaurus', rect=Rect(left=298, top=6, width=95, height=95))]
Troubleshooting
ImportError: Unable to find dmtx shared library
Error output:
Install the libdmtx library.
See also
Favorite site
Pages that link here