Self-contained DataMatrix encode/decode (vendored libdmtx, bundled on every OS, free-threading safe) - a modern pylibdmtx successor
Project description
arbez-dmtx
Read and write Data Matrix barcodes from Python — with the native
libdmtx library bundled in the wheel on every
platform. No brew install / apt-get install, no compiler. Pure ctypes,
so one small wheel per platform works on all of Python 3.10–3.14, including
free-threaded 3.13t / 3.14t.
from arbez_dmtx import decode, encode
from PIL import Image
decode(Image.open("code.png"))
# [Decoded(data=b'Stegosaurus', rect=Rect(left=5, top=6, width=96, height=95))]
enc = encode(b"hello")
Image.frombytes("RGB", (enc.width, enc.height), enc.pixels).save("dmtx.png")
Install
pip install arbez-dmtx
That's it — the libdmtx shared library is inside the wheel. No system packages.
Supported platforms (wheels are published for these; there is no sdist, so
pip install requires a matching wheel):
| OS | Arch | Wheel |
|---|---|---|
| macOS | arm64 (Apple Silicon) | ✅ |
| Linux | x86_64, aarch64 (glibc / manylinux_2_28) | ✅ |
| Windows | x86_64 | ✅ |
Not yet built: macOS x86_64 (Intel), musllinux (Alpine), Windows arm64. If you need one, open an issue.
Relationship to pylibdmtx
arbez-dmtx is a friendly, modernised continuation of pylibdmtx by Lawrence Hudson / the Natural History Museum (MIT). It vendors pylibdmtx's excellent ctypes wrapper and keeps the same public API, but closes the gaps that made pylibdmtx awkward to depend on in 2026:
| pylibdmtx | arbez-dmtx | |
|---|---|---|
| Native libdmtx bundled | Windows only | every OS (macOS arm64, Linux x86_64/aarch64, Windows) |
| Off-Windows install | brew/apt the system lib yourself |
nothing — it's in the wheel |
| Python support | 2.7, 3.5–3.10 | 3.10–3.14 incl. free-threaded 3.13t/3.14t |
| Bundled libdmtx | 0.7.x (older) | tracks upstream (currently 0.7.8) via a CI watcher |
distutils |
required (broken on 3.12+) | removed |
| PyPI freshness | stale | maintained |
Migrating is a one-line import swap — the function/return signatures match:
# before
from pylibdmtx.pylibdmtx import decode, encode
# after
from arbez_dmtx import decode, encode
If you only need this library on Windows, pylibdmtx already works great; the value here is everywhere else (and on the new free-threaded interpreters).
API
The full pylibdmtx surface is re-exported at the top level:
from arbez_dmtx import (
decode, encode, # the two operations
Decoded, Rect, Encoded, # result types
ENCODING_SCHEME_NAMES, ENCODING_SIZE_NAMES, # encode() vocabularies
PyLibDMTXError, # error type
libdmtx_version, # bundled libdmtx version string
)
decode(image, ...)accepts aPIL.Image, anumpy.ndarray(e.g. from OpenCV), or a(pixels, width, height)tuple, and the full libdmtx tuning surface:timeout,gap_size,shrink,shape,deviation,threshold,min_edge,max_edge,corrections,max_count. Returns a list ofDecoded(data: bytes, rect: Rect).encode(data, scheme=None, size=None)→Encoded(width, height, bpp, pixels);scheme/sizecome fromENCODING_SCHEME_NAMES/ENCODING_SIZE_NAMES.
Why pure ctypes?
No compiled extension means (a) one py3-none-<platform> wheel covers every
Python version — including the free-threaded builds, with no per-ABI matrix —
and (b) importing it never re-enables the GIL; ctypes releases the GIL
around each native call, so concurrent decode is safe on 3.13t/3.14t.
License & attribution
Apache-2.0 (this wrapper). Bundles libdmtx (BSD-2-Clause, © Mike Laughton,
Vadim A. Misbakh-Soloviov and others) and vendors the pylibdmtx ctypes
wrapper (MIT, © Lawrence Hudson). Full notices in NOTICE; the libdmtx
license also ships inside each wheel as THIRD_PARTY_LICENSES_libdmtx.txt.
Not affiliated with or endorsed by the pylibdmtx authors — just standing on their shoulders, gratefully.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arbez_dmtx-0.0.1-py3-none-win_amd64.whl.
File metadata
- Download URL: arbez_dmtx-0.0.1-py3-none-win_amd64.whl
- Upload date:
- Size: 71.4 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a13ed07b42327acc9aec2319daa073ae77bd0667baf1b9272948c663d5a66aa
|
|
| MD5 |
aa3bd93f1a9f83a8c2e2e254f38baa53
|
|
| BLAKE2b-256 |
c37d488425974a9c7a96b0dcfb3d8143b8995244da8c5facccbad093b242e19e
|
Provenance
The following attestation bundles were made for arbez_dmtx-0.0.1-py3-none-win_amd64.whl:
Publisher:
release.yml on arbez-org/arbez-dmtx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arbez_dmtx-0.0.1-py3-none-win_amd64.whl -
Subject digest:
5a13ed07b42327acc9aec2319daa073ae77bd0667baf1b9272948c663d5a66aa - Sigstore transparency entry: 1831941935
- Sigstore integration time:
-
Permalink:
arbez-org/arbez-dmtx@ab58f06e3a41f36534ad2f57d03cb7a79f737ac0 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/arbez-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ab58f06e3a41f36534ad2f57d03cb7a79f737ac0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file arbez_dmtx-0.0.1-py3-none-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: arbez_dmtx-0.0.1-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 325.8 kB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec4f856df0b11e36d693132a5edf827c0ecc79d1b21e4e1cfe5a2c33ed90526b
|
|
| MD5 |
b6552adf83e78694d72618b6f0aac0d7
|
|
| BLAKE2b-256 |
5f0fde88e683db8c234c62e87bcf797e80e6fbfe996104be64aa33aee52241f1
|
Provenance
The following attestation bundles were made for arbez_dmtx-0.0.1-py3-none-manylinux_2_28_x86_64.whl:
Publisher:
release.yml on arbez-org/arbez-dmtx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arbez_dmtx-0.0.1-py3-none-manylinux_2_28_x86_64.whl -
Subject digest:
ec4f856df0b11e36d693132a5edf827c0ecc79d1b21e4e1cfe5a2c33ed90526b - Sigstore transparency entry: 1831942055
- Sigstore integration time:
-
Permalink:
arbez-org/arbez-dmtx@ab58f06e3a41f36534ad2f57d03cb7a79f737ac0 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/arbez-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ab58f06e3a41f36534ad2f57d03cb7a79f737ac0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file arbez_dmtx-0.0.1-py3-none-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: arbez_dmtx-0.0.1-py3-none-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 315.4 kB
- Tags: Python 3, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acb6a37143d0fbc4835bc96f3842c2a451e0128e0bd1f0408b938c0006864a18
|
|
| MD5 |
245e7df2875240b52d231b9bcb647c27
|
|
| BLAKE2b-256 |
eae2dcc8adee730ae1b7281c227f58c05f9088fc0eef0e0888968cfa23db8cd8
|
Provenance
The following attestation bundles were made for arbez_dmtx-0.0.1-py3-none-manylinux_2_28_aarch64.whl:
Publisher:
release.yml on arbez-org/arbez-dmtx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arbez_dmtx-0.0.1-py3-none-manylinux_2_28_aarch64.whl -
Subject digest:
acb6a37143d0fbc4835bc96f3842c2a451e0128e0bd1f0408b938c0006864a18 - Sigstore transparency entry: 1831942176
- Sigstore integration time:
-
Permalink:
arbez-org/arbez-dmtx@ab58f06e3a41f36534ad2f57d03cb7a79f737ac0 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/arbez-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ab58f06e3a41f36534ad2f57d03cb7a79f737ac0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file arbez_dmtx-0.0.1-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: arbez_dmtx-0.0.1-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 120.3 kB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e09369b175a3ab362c6f7fbd5f7cce4de3de9adb3803bba3f8ea4af93931bb5
|
|
| MD5 |
ef780b3554a9b0fee8a91a5518520b2b
|
|
| BLAKE2b-256 |
d2b6c4d3ec367d4ccf401e2de4f7f53aa1867deed455a233dc51d813b72a283e
|
Provenance
The following attestation bundles were made for arbez_dmtx-0.0.1-py3-none-macosx_11_0_arm64.whl:
Publisher:
release.yml on arbez-org/arbez-dmtx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arbez_dmtx-0.0.1-py3-none-macosx_11_0_arm64.whl -
Subject digest:
9e09369b175a3ab362c6f7fbd5f7cce4de3de9adb3803bba3f8ea4af93931bb5 - Sigstore transparency entry: 1831942284
- Sigstore integration time:
-
Permalink:
arbez-org/arbez-dmtx@ab58f06e3a41f36534ad2f57d03cb7a79f737ac0 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/arbez-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ab58f06e3a41f36534ad2f57d03cb7a79f737ac0 -
Trigger Event:
push
-
Statement type: