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.15-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.15.post1

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.15.post1
File Actions
libscanner_unir-1.2.15.post1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for libscanner_unir-1.2.15.post1-py3-none-win_amd64.whl
libscanner_unir-1.2.15.post1-py3-none-manylinux_2_36_x86_64.whl Python 3 none Linux glibc 2.36+ x86-64 Details for libscanner_unir-1.2.15.post1-py3-none-manylinux_2_36_x86_64.whl
libscanner_unir-1.2.15.post1-py3-none-manylinux_2_36_armv7l.whl Python 3 none Linux glibc 2.36+ ARMv7l Details for libscanner_unir-1.2.15.post1-py3-none-manylinux_2_36_armv7l.whl
libscanner_unir-1.2.15.post1-py3-none-manylinux_2_36_aarch64.whl Python 3 none Linux glibc 2.36+ ARM64 Details for libscanner_unir-1.2.15.post1-py3-none-manylinux_2_36_aarch64.whl

Total release size: 21.4 MB

Release files / libscanner_unir-1.2.15.post1-py3-none-win_amd64.whl

Download URL libscanner_unir-1.2.15.post1-py3-none-win_amd64.whl
Size 6.4 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
dffb3d6458bba9ff2df00ada57e9485b72f5e898edcfec37f3fa36feddd64d99
BLAKE2b-256 checksum
How to use checksums
0246cb58e55e61ae7ee12d0859ae9f3d2fd89db7f0c7e544c11e0f7da6c57f19
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.15.post1-py3-none-manylinux_2_36_x86_64.whl

Download URL libscanner_unir-1.2.15.post1-py3-none-manylinux_2_36_x86_64.whl
Size 5.5 MB
Tags Linux glibc 2.36+ x86-64 Python 3
SHA-256 checksum
How to use checksums
faeb42582d56f700ebc89bfa5e65a1fe8e267c4f9b8421d60cf62a2462df1e6c
BLAKE2b-256 checksum
How to use checksums
f8162bdcc302e5d61f3865a09c233a7915cf8579ae61f1246bec06f41fe2475b
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.15.post1-py3-none-manylinux_2_36_armv7l.whl

Download URL libscanner_unir-1.2.15.post1-py3-none-manylinux_2_36_armv7l.whl
Size 4.4 MB
Tags Linux glibc 2.36+ ARMv7l Python 3
SHA-256 checksum
How to use checksums
a710d2af0885f5422809c790f4bdb596e9c01e7519c3f56fdaf1a8e47251b638
BLAKE2b-256 checksum
How to use checksums
4e04c05ecf7b23372882d6a037258a2768523bd2664fbaef78e2539c09db757e
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.15.post1-py3-none-manylinux_2_36_aarch64.whl

Download URL libscanner_unir-1.2.15.post1-py3-none-manylinux_2_36_aarch64.whl
Size 5.2 MB
Tags Linux glibc 2.36+ ARM64 Python 3
SHA-256 checksum
How to use checksums
6fec8aa4e29fad5e9515f3ff26496b94eb05b7cbe9012d6c7e11cdebe18546e0
BLAKE2b-256 checksum
How to use checksums
89aa71f4a6aaea347cfc29278ed694f61e2c12a421fbc0672218cd125b2af0b1
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.15.post1

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