Skip to main content

libscanner unir — DataMatrix, QR and barcode reader in one call

Commercial, closed-source software. The first 30 days on a machine work without a license key and without internet; after that a paid license is required: https://libscanner.com/en/pricing/.

  • Reads DataMatrix, QR, GS1-128 (SSCC), Code 128, EAN-13/8 and UPC-A/E in one call, including many codes in one image (a built-in neural network finds them first).
  • 72% of 6,899 barcodes on public datasets vs 54–56% for zxing-cpp and ZBar, with zero false reads on images without a code: https://github.com/libscanner/barcode-1d-benchmark
  • Returns the exact code bytes with the GS (0x1D) separator kept.
  • Windows x64; Linux x86-64, ARM64 and ARMv7 including Raspberry Pi (glibc 2.36+: Debian 12, Ubuntu 23.04+, Raspberry Pi OS Bookworm). Python 3.9+.
  • Documentation: https://libscanner.com/en/docs/universal-reader/
import unir

result = unir.scan_file("label.jpg", unir.Settings.multi(0))   # 0 = all codes in the image
for code in result.codes:
    print(code.symbology_name, code.text)

The original package description (in Russian, with an English summary) follows.


unir — универсальный ридер кодов для Python

Коммерческая библиотека с закрытым исходным кодом. Это не открытый проект: в колесе — собранная библиотека и обёртка, исходники не публикуются. Пробный период — 30 дней, затем нужна платная лицензия (https://libscanner.com).

Commercial, closed-source software. Not open source: the wheel ships a prebuilt library and a wrapper, the source code is not published. 30-day free trial, then a paid license is required (https://libscanner.com/en/).

Читает одним вызовом коды разных символик на одном кадре: DataMatrix (ECC200, ГОСТ Р ИСО/МЭК 16022, коды «Честного знака»), QR (модель 2, версии 1–40), Code 128, GS1-128 (SSCC), EAN-13, EAN-8, UPC-A и UPC-E. Кадры камеры и конвейера, фото этикеток. Сеть-разведчик встроена в библиотеку и включается сама (Settings.use_net = None): без выбора символик — всегда, с выбором — при нескольких кодах и DataMatrix или QR в наборе. С ней кадр с несколькими кодами читается быстрее и полнее; True — всегда, False — без сети.

Документация: https://libscanner.com/docs/universal-reader/?lang=python

English. A universal barcode reader for Python: DataMatrix (GS1), QR, Code 128, GS1-128 (SSCC), EAN-13/8, UPC-A/E in one call. A scout network is built into the library and switches on by itself (Settings.use_net = None; True — always, False — off). Import as unir. Windows x64 and Linux (x86-64, ARM64, ARMv7, glibc 2.36+). 30-day free trial, then a license from https://libscanner.com/en/. Documentation: https://libscanner.com/en/docs/universal-reader/?lang=python

Что внутри

  • пакет unir — обёртка на ctypes, без внешних зависимостей;
  • собранная библиотека unir_c (unir_c.dll / libunir_c.so) в unir/_lib/;
  • сеть-разведчик — внутри unir_c, включается сама (Settings.use_net: None — авто, True — всегда, False — без сети);
  • утилита командной строки unir — после установки это команда окружения (и python -m unir): unir снимок.png, unir --license status, справка — unir --help.

Компилировать ничего не нужно: колесо уже содержит библиотеку под свою платформу и годится для любого Python 3.9+.

Установка

pip install libscanner_unir-1.2.18-py3-none-<платформа>.whl

Колесо — в разделе «Загрузки» личного кабинета https://libscanner.com. Пакет импортируется как unir. Платформы: Windows x64, Linux x86-64, ARM64 и ARMv7 (glibc 2.36 и новее: Debian 12, Ubuntu 23.04+, Raspberry Pi OS Bookworm).

Быстрый старт

import unir

result = unir.scan_file("этикетка.jpg", unir.Settings.multi(0))   # все коды на снимке
for code in result.codes:
    print(code.symbology_name, code.text)

Только нужные символики и предел времени на кадр:

s = unir.Settings.single()
s.symbologies = unir.Symbology.DATAMATRIX | unir.Symbology.GS1_128
s.budget_ms = 200
scanner = unir.Scanner(s)            # создаётся один раз, а не на кадр
result = scanner.scan_file("кадр.png")

Кадр из чужого буфера — без копирования, видом на него:

view = unir.ImageView(buf, width, height, stride, unir.PixelFormat.GRAY8)
result = scanner.scan(view)

Code.text — bytes: разделитель GS1 остаётся байтом 0x1D.

Лицензия

Пробный период — 30 дней с первого запуска на машине, без регистрации и без сети.

Активация: вписать ключ из письма (UNIR-...) в текстовый файл unir.key и положить его в каталог unir/_lib/ установленного пакета — рядом с библиотекой и утилитой (ключ у них общий). Каталог показывает

python -c "import unir, os; print(os.path.join(os.path.dirname(unir.__file__), '_lib'))"

Библиотека активирует ключ по сети сама при первом обращении. Из кода:

import unir.license as license

s = license.status()
if not s["can_scan"]:
    print(s["message"])

Без интернета: личный кабинет https://libscanner.com → Лицензии → «Активация без интернета».

Metadata

Release files for libscanner-unir 1.2.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for libscanner-unir 1.2.18
File Actions
libscanner_unir-1.2.18-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for libscanner_unir-1.2.18-py3-none-win_amd64.whl
libscanner_unir-1.2.18-py3-none-manylinux_2_36_x86_64.whl Python 3 none Linux glibc 2.36+ x86-64 Details for libscanner_unir-1.2.18-py3-none-manylinux_2_36_x86_64.whl
libscanner_unir-1.2.18-py3-none-manylinux_2_36_armv7l.whl Python 3 none Linux glibc 2.36+ ARMv7l Details for libscanner_unir-1.2.18-py3-none-manylinux_2_36_armv7l.whl
libscanner_unir-1.2.18-py3-none-manylinux_2_36_aarch64.whl Python 3 none Linux glibc 2.36+ ARM64 Details for libscanner_unir-1.2.18-py3-none-manylinux_2_36_aarch64.whl

Total release size: 19.4 MB

Release files / libscanner_unir-1.2.18-py3-none-win_amd64.whl

Download URL libscanner_unir-1.2.18-py3-none-win_amd64.whl
Size 6.0 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
808c5ddf1f3995fdf8fe5a6750b332db95a23b4eb642482e9d3000f7d41e199f
BLAKE2b-256 checksum
How to use checksums
74f1c16030efbeb94cffe06d1eaf5b2d5167b71b1b187fbc9c757ba08c79c8db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / libscanner_unir-1.2.18-py3-none-manylinux_2_36_x86_64.whl

Download URL libscanner_unir-1.2.18-py3-none-manylinux_2_36_x86_64.whl
Size 5.1 MB
Tags Linux glibc 2.36+ x86-64 Python 3
SHA-256 checksum
How to use checksums
1a67e96e819ebd9ce9e7280f4c59b620c624fdf0d6cbad9d634288d52ff21c70
BLAKE2b-256 checksum
How to use checksums
1d2e2fbcebccb0157f41c804857550939959dd57e4b4a999842a2964fece06c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / libscanner_unir-1.2.18-py3-none-manylinux_2_36_armv7l.whl

Download URL libscanner_unir-1.2.18-py3-none-manylinux_2_36_armv7l.whl
Size 3.7 MB
Tags Linux glibc 2.36+ ARMv7l Python 3
SHA-256 checksum
How to use checksums
3fbf1c4fb490089aea73bad19d68cf5a44dff7c71c1c555d47bc2ef4d3e0b68e
BLAKE2b-256 checksum
How to use checksums
2a5391f003b521e8d5a5634382a05cc01f3e6dc573e0a529b9fd7d3333f29369
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / libscanner_unir-1.2.18-py3-none-manylinux_2_36_aarch64.whl

Download URL libscanner_unir-1.2.18-py3-none-manylinux_2_36_aarch64.whl
Size 4.7 MB
Tags Linux glibc 2.36+ ARM64 Python 3
SHA-256 checksum
How to use checksums
fe51043274630423721b8fb1668fa72f66426837a4a5a76fbdaef71b639d460e
BLAKE2b-256 checksum
How to use checksums
99076ff73c2e68a014f628ccfd5529e7857c5d034ac105bf291fbdec06bcbc8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for libscanner-unir 1.2.18

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page