Registry / serialization / pylibdmtx

pylibdmtx

JSON →
library0.1.10pypypiunverified

Python library for reading and writing Data Matrix barcodes, wrapping the libdmtx C library. Current version 0.1.10, low release cadence.

pip install pylibdmtx
INSTALL
IMPORT
SIG · PYLIBDMTX
P
pylibdmtx
serializationpythonv0.1.10
Install
1.7s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage

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

decode
import pylibdmtx.pylibdmtx; decode = pylibdmtx.pylibdmtx.decode
from pylibdmtx import decode
encode
import pylibdmtx.pylibdmtx; encode = pylibdmtx.pylibdmtx.encode
from pylibdmtx import encode

Decode a Data Matrix barcode from an image file.

from PIL import Image from pylibdmtx.pylibdmtx import decode image = Image.open('datamatrix.png') results = decode(image) for result in results: print(result.data.decode('utf-8'))
Debug
Known issues
breakingOn Windows, libdmtx.dll must be in PATH. Use conda or manually add DLL directory.
fix
Install via conda-forge (includes bundled DLL) or copy libdmtx.dll to a PATH directory.
affects: all
gotchadecode() returns bytes, not str. Must call .decode('utf-8') on data.
fix
Use result.data.decode('utf-8') or appropriate encoding.
affects: all
gotchaInput image must be PIL Image, not file path. Open with Image.open() first.
fix
Always pass a PIL Image object to decode().
affects: all
deprecatedPython 2 support is deprecated; library still installs but may break on Python 2 EOL.
fix
Use Python 3.6+.
affects: <=0.1.10
Upgrade
Version history
0.1.10latest on PyPI · released Mar 15, 2022
Audit
Dependencies
PillowrequiredRequired for opening and processing images.
libdmtxrequiredShared library dependency; must be installed on the system.
Agent activity
36 hits · last 30 days
node
30
Resources
pylibdmtx — pip install pylibdmtx · libregistry