Skip to content

About

Universal barcode reader library (C++/C ABI/Python/CLI): DataMatrix, GS1-128 (SSCC), Code 128, EAN/UPC in one call — prebuilt binaries, headers, examples

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

English | Русский

Universal code reader library (unir)

Reads codes of several symbologies in a frame with one call: DataMatrix (ECC 200, including GS1 / Chestny ZNAK marking codes — the Russian national product marking system), GS1-128 (SSCC on logistics labels), Code 128 and retail barcodes EAN-13, EAN-8, UPC-A, UPC-E.

unir is a commercial, closed-source C++20 library with a flat C ABI, a Python package and a command-line tool. Inside it are two engines: the dmr DataMatrix reader and a linear-barcode engine; one time budget per frame is shared between them. One license covers both.

This repository contains the public headers, examples, documentation links and license texts. It contains no library source code. Prebuilt binaries are attached to GitHub Releases.

For AI coding assistants: start with llms.txt — an index of the headers, examples and the full documentation in Markdown.

Read a code online from a photo — free, in the browser, nothing to install.

Platforms

Platform C++ static library + C ABI + CLI Python wheel
Windows x64 unir-1.0.1-windows-x64.zip libscanner_unir-1.0.1-py3-none-win_amd64.whl
Linux x86-64 unir-1.0.1-linux-x64.tar.gz libscanner_unir-1.0.1-py3-none-manylinux_2_36_x86_64.whl
Linux ARM64 (Raspberry Pi 3/4/5, 64-bit) unir-1.0.1-linux-arm64.tar.gz libscanner_unir-1.0.1-py3-none-manylinux_2_36_aarch64.whl
Linux ARMv7 (Raspberry Pi 2/3/4/5, 32-bit) unir-1.0.1-linux-armhf.tar.gz libscanner_unir-1.0.1-py3-none-manylinux_2_36_armv7l.whl

Each platform also has a CLI-only archive (…-cli.zip / …-cli.tar.gz) with just the unir tool.

  • Windows packages are built with MinGW-w64 GCC (MSYS2 MINGW64). MSVC and other compilers use the C ABI (unir_c.dll).
  • Linux packages are built with GCC 12 on Debian 12 (glibc 2.36): GCC 12 or newer is required for the C++ API; wheels need glibc 2.36+ (Debian 12 / Raspberry Pi OS Bookworm or newer).
  • Python 3.9 or newer, no dependencies.

Download

Trial

Every build works for 30 days from the first run on a machine — no registration, no key, no network access during the trial. After that a license key from https://libscanner.com is required; until then scan() returns Status::Unlicensed without processing the frame.

Package contents

include/unir/{Unir,Geometry,Image,License,Scanner,Settings,Symbology,Version}.h   C++ API
include/unir/unir_c.h              C ABI
lib/libunir.a                      C++ static library
lib/pkgconfig/unir.pc
lib/libunir_c.so | bin/unir_c.dll  C ABI library (+ lib/unir_c.dll.a on Windows)
lib/pkgconfig/unir_c.pc
bin/unir                           command-line tool
share/doc/unir/licenses/           third-party licenses

The headers in include/ of this repository declare exactly the same API as the headers shipped in the 1.0.1 packages; only the comments differ (translated to English here, Russian in the packages).

Quick start

C++

#include <unir/Unir.h>
#include <iostream>

int main() {
    unir::Settings settings = unir::Settings::multi(0);   // every code in the frame
    settings.symbologies = unir::kAllSymbologies;         // or e.g. Symbology::DataMatrix | Symbology::Gs1_128

    const unir::Scanner scanner(settings);
    const unir::ScanResult r = scanner.scanFile("label.jpg");  // loading counts against the frame deadline

    for (const unir::Code& c : r.codes)
        std::cout << unir::nameOf(c.symbology) << ": " << c.text << "\n";
}

Link statically through pkg-config — the query must be --static:

PKG_CONFIG_PATH=/path/to/unir-1.0.1-linux-x64/lib/pkgconfig pkg-config --static --cflags --libs unir

A frame from your own capture pipeline (camera SDK, OpenCV buffer, bitmap) is passed as a view over the existing buffer, without copying:

const unir::ImageView view{ m.data, m.cols, m.rows, (int)m.step, unir::PixelFormat::Bgr8 };
const unir::ScanResult r = scanner.scan(view);

Complete example: examples/cpp. C ABI example (MSVC, other languages): examples/c.

Python

pip install libscanner-unir     # PyPI: Windows x64, Linux x86-64 / ARM64 / ARMv7 (glibc 2.36+)
import unir

result = unir.scan_file("label.jpg", unir.Settings.multi(0))
for code in result.codes:
    print(code.symbology_name, code.text.decode("utf-8", errors="replace"))

Code.text is bytes: the GS1 separator stays as byte 0x1D. The wheel also installs the unir command. Example: examples/python.

Command line

unir label.jpg
unir label.jpg --codes 0 --sym dm,gs1
unir --folder ./frames
unir --license status --json

More commands: examples/cli.

Messages are in the system language — English on any non-Russian system, Russian on a Russian one; --lang en|ru or the LIBSCANNER_LANG environment variable set it explicitly.

Documentation

License

Proprietary — see LICENSE.txt (End User License Agreement; the Russian text is binding, LICENSE.en.txt is an English translation for information). Starting to use the software means accepting the agreement.

Third-party components: THIRD-PARTY-NOTICES.txt and the license texts in licenses/.

Code in examples/ is licensed under MIT-0 (examples/LICENSE) — copy it into your projects freely; the library itself is proprietary (LICENSE.txt).

Contact

“GS1” is a trademark of GS1 AISBL. “Chestny ZNAK” («Честный знак») is a trademark of Operator-CRPT LLC (ООО «Оператор-ЦРПТ»). This product is not affiliated with or certified by the owners of these marks; the names are used only to describe the supported formats.

About

Universal barcode reader library (C++/C ABI/Python/CLI): DataMatrix, GS1-128 (SSCC), Code 128, EAN/UPC in one call — prebuilt binaries, headers, examples

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages