Skip to main content

Self-contained DataMatrix encode/decode (vendored libdmtx, bundled on every OS, free-threading safe) - a modern pylibdmtx successor

Project description

arbez-dmtx

CI Python 3.10–3.14 License: Apache-2.0

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 a PIL.Image, a numpy.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 of Decoded(data: bytes, rect: Rect).
  • encode(data, scheme=None, size=None)Encoded(width, height, bpp, pixels); scheme/size come from ENCODING_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

arbez_dmtx-0.0.1-py3-none-win_amd64.whl (71.4 kB view details)

Uploaded Python 3Windows x86-64

arbez_dmtx-0.0.1-py3-none-manylinux_2_28_x86_64.whl (325.8 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

arbez_dmtx-0.0.1-py3-none-manylinux_2_28_aarch64.whl (315.4 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

arbez_dmtx-0.0.1-py3-none-macosx_11_0_arm64.whl (120.3 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

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

Hashes for arbez_dmtx-0.0.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 5a13ed07b42327acc9aec2319daa073ae77bd0667baf1b9272948c663d5a66aa
MD5 aa3bd93f1a9f83a8c2e2e254f38baa53
BLAKE2b-256 c37d488425974a9c7a96b0dcfb3d8143b8995244da8c5facccbad093b242e19e

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arbez_dmtx-0.0.1-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for arbez_dmtx-0.0.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ec4f856df0b11e36d693132a5edf827c0ecc79d1b21e4e1cfe5a2c33ed90526b
MD5 b6552adf83e78694d72618b6f0aac0d7
BLAKE2b-256 5f0fde88e683db8c234c62e87bcf797e80e6fbfe996104be64aa33aee52241f1

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arbez_dmtx-0.0.1-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for arbez_dmtx-0.0.1-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 acb6a37143d0fbc4835bc96f3842c2a451e0128e0bd1f0408b938c0006864a18
MD5 245e7df2875240b52d231b9bcb647c27
BLAKE2b-256 eae2dcc8adee730ae1b7281c227f58c05f9088fc0eef0e0888968cfa23db8cd8

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arbez_dmtx-0.0.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arbez_dmtx-0.0.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9e09369b175a3ab362c6f7fbd5f7cce4de3de9adb3803bba3f8ea4af93931bb5
MD5 ef780b3554a9b0fee8a91a5518520b2b
BLAKE2b-256 d2b6c4d3ec367d4ccf401e2de4f7f53aa1867deed455a233dc51d813b72a283e

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page