Author: kitajusSus
Last updated: 2025-08-22
Archiwizator is a desktop application designed to automate the archiving of scanned PDF documents. The program uses an OCR engine (Tesseract) to read document content and a NER model (based on the spaCy library) to recognize and extract key information such as dates, organization names, document titles, or court case numbers. The project is developed with Windows 11 in mind.
The application enables intelligent sorting and naming of files based on their contents, significantly speeding up and standardizing work with a digital archive.
A full user guide with step-by-step instructions is available in Dokumentacja_Uzytkownika.md.
C:\Program Files\Archiwizator)Archiwizator.exeRequired tools:
training_ocr modulepip install pyinstaller)Clone the repository:
git clone https://github.com/kitajusSus/archiwizacja-IGG-helper.git
cd archiwizacja-IGG-helper
Create a virtual environment:
python -m venv venv
venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
pip install bitsandbytes
The bitsandbytes package is required to support 4-bit quantization of the text assistant mode.
Download Tesseract libraries (headers and dlls):
python fetch_tesseract.py
The script automatically downloads and extracts a precompiled Tesseract package
(by default the latest build for Windows or the 5.4.0 archive for Linux) into
2_Aplikacja_Glowna/tesseract, ensuring a reproducible build process. If needed you can specify a custom link:
python fetch_tesseract.py --url <archive-link>
Run the application:
python 2_Aplikacja_Glowna/app.py
Build a standalone package (optional):
python build_exe.py
The script uses the zig compiler by default to create the training_ocr binary and PyInstaller to generate the
dist/Archiwizator folder with included licenses. Another compiler (e.g., clang++ or clang-cl) can be selected via the
--compiler option or the ARCHIWIZATOR_COMPILER environment variable.
The front end built with React and Tauri is located in gui_tauri/.
To start development mode:
cd gui_tauri
bun install
bunx tauri dev
To build a standalone application:
bunx tauri build
The Ping component uses the http://127.0.0.1:5000/ping endpoint and includes a built-in PDF preview.
Helper scripts simplifying work with the interfaces and tests are available in the scripts/ directory:
# Qt/Native GUI
bash scripts/run_gui_native.sh
# Tauri/React GUI
bash scripts/run_gui_tauri.sh
# Backend tests
bash scripts/run_tests.sh
For a quick comparison of GUI start-up times there is a gui_native/benchmark_ui.py script. It requires the PySide6 package and the standard tkinter (available in Python for Windows).
pip install -r gui_native/requirements.txt
python gui_native/benchmark_ui.py
fast_similarity moduleThe repository does not contain precompiled fast_similarity.dll,
fast_similarity.lib, or fast_similarity.pdb files. To recreate them, go to
the 2_Aplikacja_Glowna directory and run:
./build_fast_similarity.sh
The build_fast_similarity.sh script in 2_Aplikacja_Glowna can build both versions of the cosine similarity library:
the classic C implementation (libfast_similarity.so or fast_similarity.dll) and the Zig variant using SIMD
(libfast_similarity_zig.so or fast_similarity_zig.dll).
For Windows, compile the C version with:
zig cc -O3 -shared fast_similarity.c -o fast_similarity.dll
To create the fast Zig implementation (e.g., for Linux), use:
zig build-lib fast_similarity.zig -O ReleaseFast -fPIC -dynamic -femit-bin=libfast_similarity_zig.so
The script stores the libraries in the same directory, and the Python module automatically detects them here and in the native subfolder.
token_similarity moduleThe token similarity module written in Zig is located in
zig_modules/token_similarity. To build the shared library:
cd zig_modules/token_similarity
zig build -Doptimize=ReleaseFast
After compilation the libtoken_similarity.so file will be available in
zig_modules/token_similarity/zig-out/lib. The Python wrapper
python/zig_token_similarity.py exposes the token_similarity function by
loading this library with ctypes.
token_similarity module (C)The native_c directory contains a version of the same function written in C under the MIT license. To build the shared library:
cd native_c
cmake -S . -B build
cmake --build build --config Release
The resulting libtoken_similarity.so file will be located in native_c/build.
The Python module python/token_similarity.py loads this library via
ctypes and provides the token_similarity function.
On the first launch of the application:
Choose the operating mode appropriate for your documents
Select folders:
Start processing by clicking the “Scan files and analyze” button
Verify and edit results:
Save changes and move files by clicking the appropriate button
custom_ner_model directoryThis mode is intended for archiving standard company correspondence:
YYYY-MM-DD_DOCUMENT-TYPE_Subject_Sender-Recipient.pdfThis mode is intended for archiving court and legal documents:
YYYY-MM-DD_DOCUMENT-TYPE_[CaseNumber]_Document-Title_Sender.pdfError message: “ERROR: NER model not loaded!”
Solution:
moj_model_ner folder is in the same directory as the applicationmorphology directory is missing, use the following script:import spacy
import pl_core_news_md
import os
import shutil
# Script to create missing files
source_model = pl_core_news_md.load().path
target_model = os.path.join('2_Aplikacja_Glowna', 'moj_model_ner')
for root, dirs, files in os.walk(source_model):
relative_path = os.path.relpath(root, source_model)
target_path = os.path.join(target_model, relative_path) if relative_path != "." else target_model
# Create missing directories
for dir_name in dirs:
source_dir = os.path.join(root, dir_name)
dest_dir = os.path.join(target_path, dir_name)
if not os.path.exists(dest_dir):
print(f"Copying directory: {dest_dir}")
shutil.copytree(source_dir, dest_dir)
If the application logs show “Failed to load spaCy model,” install the default model with:
python -m spacy download pl_core_news_sm
Error message: “Unable to get page count. Is poppler installed and in PATH?”
Solution:
poppler folder with a bin subdirectory is in the same location as the applicationSolution:
pydanticError message: ImportError: cannot import name 'GetCoreSchemaHandler' from 'pydantic'
Solution:
pydantic to version 2 or newer:
pip install -U "pydantic>=2.0"
pip install -r requirements.txt --upgrade
The program automatically generates filenames based on detected metadata. The format depends on the selected mode and includes the date, document type, and other relevant information.
Yes. Double-click any cell in the results table to edit its contents. After saving changes, the new filename is automatically updated.
No. The application creates copies of files with new names in the destination folder. Original files remain unchanged.
Currently the application only supports exporting to Excel (.xlsx). Additional formats are planned for future versions.
| Library/Tool | License | Usage |
|---|---|---|
| spaCy | MIT | NER engine (Named Entity Recognition) |
| Pillow | HPND | Image processing |
| OpenCV | Apache 2.0 | Image processing and optimization for OCR |
| pandas | BSD | Data manipulation and export to Excel |
| openpyxl | MIT | Handling Excel files |
| pdf2image | MIT | Converting PDF to images |
| pytesseract | Apache 2.0 | OCR engine |
| tkinter | PSF | Graphical interface |
| torch | BSD | Language model support |
| transformers | Apache 2.0 | Handling the Phi-3 Mini model |
| accelerate | Apache 2.0 | Optimization of language models |
| safetensors | Apache 2.0 | Safe tensor storage |
| sentencepiece | Apache 2.0 | Text tokenization for language models |
| cryptography | Unknown | Encoding and hashing records |
All listed libraries are used in accordance with their licenses. Full texts are available on the project pages or in the respective repositories.
Archiwizator is distributed under the Apache 2.0 license. See the LICENSE file included with the application for details.
python -m venv venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows
pip install -r requirements.txt
pip install -e .[ocr,training]
cmake -S native_c -B native_c/build
cmake --build native_c/build --config Release
cd zig_modules/token_similarity
zig build -Drelease-safe
cd ../..
pytest
python build_exe.py
Optionally specify a different compiler, e.g.:
python build_exe.py --compiler clang++
Detailed guidelines can be found in CONTRIBUTING.md and the technical documentation Dokumentacja_Techniczna.md.
24 commits
4 commits
Python
91.7%
C++
3.3%
C
1.9%
Zig
1.1%
Author: kitajusSus
Last updated: 2025-08-22
Archiwizator is a desktop application designed to automate the archiving of scanned PDF documents. The program uses an OCR engine (Tesseract) to read document content and a NER model (based on the spaCy library) to recognize and extract key information such as dates, organization names, document titles, or court case numbers. The project is developed with Windows 11 in mind.
The application enables intelligent sorting and naming of files based on their contents, significantly speeding up and standardizing work with a digital archive.
A full user guide with step-by-step instructions is available in Dokumentacja_Uzytkownika.md.
C:\Program Files\Archiwizator)Archiwizator.exeRequired tools:
training_ocr modulepip install pyinstaller)Clone the repository:
git clone https://github.com/kitajusSus/archiwizacja-IGG-helper.git
cd archiwizacja-IGG-helper
Create a virtual environment:
python -m venv venv
venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
pip install bitsandbytes
The bitsandbytes package is required to support 4-bit quantization of the text assistant mode.
Download Tesseract libraries (headers and dlls):
python fetch_tesseract.py
The script automatically downloads and extracts a precompiled Tesseract package
(by default the latest build for Windows or the 5.4.0 archive for Linux) into
2_Aplikacja_Glowna/tesseract, ensuring a reproducible build process. If needed you can specify a custom link:
python fetch_tesseract.py --url <archive-link>
Run the application:
python 2_Aplikacja_Glowna/app.py
Build a standalone package (optional):
python build_exe.py
The script uses the zig compiler by default to create the training_ocr binary and PyInstaller to generate the
dist/Archiwizator folder with included licenses. Another compiler (e.g., clang++ or clang-cl) can be selected via the
--compiler option or the ARCHIWIZATOR_COMPILER environment variable.
The front end built with React and Tauri is located in gui_tauri/.
To start development mode:
cd gui_tauri
bun install
bunx tauri dev
To build a standalone application:
bunx tauri build
The Ping component uses the http://127.0.0.1:5000/ping endpoint and includes a built-in PDF preview.
Helper scripts simplifying work with the interfaces and tests are available in the scripts/ directory:
# Qt/Native GUI
bash scripts/run_gui_native.sh
# Tauri/React GUI
bash scripts/run_gui_tauri.sh
# Backend tests
bash scripts/run_tests.sh
For a quick comparison of GUI start-up times there is a gui_native/benchmark_ui.py script. It requires the PySide6 package and the standard tkinter (available in Python for Windows).
pip install -r gui_native/requirements.txt
python gui_native/benchmark_ui.py
fast_similarity moduleThe repository does not contain precompiled fast_similarity.dll,
fast_similarity.lib, or fast_similarity.pdb files. To recreate them, go to
the 2_Aplikacja_Glowna directory and run:
./build_fast_similarity.sh
The build_fast_similarity.sh script in 2_Aplikacja_Glowna can build both versions of the cosine similarity library:
the classic C implementation (libfast_similarity.so or fast_similarity.dll) and the Zig variant using SIMD
(libfast_similarity_zig.so or fast_similarity_zig.dll).
For Windows, compile the C version with:
zig cc -O3 -shared fast_similarity.c -o fast_similarity.dll
To create the fast Zig implementation (e.g., for Linux), use:
zig build-lib fast_similarity.zig -O ReleaseFast -fPIC -dynamic -femit-bin=libfast_similarity_zig.so
The script stores the libraries in the same directory, and the Python module automatically detects them here and in the native subfolder.
token_similarity moduleThe token similarity module written in Zig is located in
zig_modules/token_similarity. To build the shared library:
cd zig_modules/token_similarity
zig build -Doptimize=ReleaseFast
After compilation the libtoken_similarity.so file will be available in
zig_modules/token_similarity/zig-out/lib. The Python wrapper
python/zig_token_similarity.py exposes the token_similarity function by
loading this library with ctypes.
token_similarity module (C)The native_c directory contains a version of the same function written in C under the MIT license. To build the shared library:
cd native_c
cmake -S . -B build
cmake --build build --config Release
The resulting libtoken_similarity.so file will be located in native_c/build.
The Python module python/token_similarity.py loads this library via
ctypes and provides the token_similarity function.
On the first launch of the application:
Choose the operating mode appropriate for your documents
Select folders:
Start processing by clicking the “Scan files and analyze” button
Verify and edit results:
Save changes and move files by clicking the appropriate button
custom_ner_model directoryThis mode is intended for archiving standard company correspondence:
YYYY-MM-DD_DOCUMENT-TYPE_Subject_Sender-Recipient.pdfThis mode is intended for archiving court and legal documents:
YYYY-MM-DD_DOCUMENT-TYPE_[CaseNumber]_Document-Title_Sender.pdfError message: “ERROR: NER model not loaded!”
Solution:
moj_model_ner folder is in the same directory as the applicationmorphology directory is missing, use the following script:import spacy
import pl_core_news_md
import os
import shutil
# Script to create missing files
source_model = pl_core_news_md.load().path
target_model = os.path.join('2_Aplikacja_Glowna', 'moj_model_ner')
for root, dirs, files in os.walk(source_model):
relative_path = os.path.relpath(root, source_model)
target_path = os.path.join(target_model, relative_path) if relative_path != "." else target_model
# Create missing directories
for dir_name in dirs:
source_dir = os.path.join(root, dir_name)
dest_dir = os.path.join(target_path, dir_name)
if not os.path.exists(dest_dir):
print(f"Copying directory: {dest_dir}")
shutil.copytree(source_dir, dest_dir)
If the application logs show “Failed to load spaCy model,” install the default model with:
python -m spacy download pl_core_news_sm
Error message: “Unable to get page count. Is poppler installed and in PATH?”
Solution:
poppler folder with a bin subdirectory is in the same location as the applicationSolution:
pydanticError message: ImportError: cannot import name 'GetCoreSchemaHandler' from 'pydantic'
Solution:
pydantic to version 2 or newer:
pip install -U "pydantic>=2.0"
pip install -r requirements.txt --upgrade
The program automatically generates filenames based on detected metadata. The format depends on the selected mode and includes the date, document type, and other relevant information.
Yes. Double-click any cell in the results table to edit its contents. After saving changes, the new filename is automatically updated.
No. The application creates copies of files with new names in the destination folder. Original files remain unchanged.
Currently the application only supports exporting to Excel (.xlsx). Additional formats are planned for future versions.
| Library/Tool | License | Usage |
|---|---|---|
| spaCy | MIT | NER engine (Named Entity Recognition) |
| Pillow | HPND | Image processing |
| OpenCV | Apache 2.0 | Image processing and optimization for OCR |
| pandas | BSD | Data manipulation and export to Excel |
| openpyxl | MIT | Handling Excel files |
| pdf2image | MIT | Converting PDF to images |
| pytesseract | Apache 2.0 | OCR engine |
| tkinter | PSF | Graphical interface |
| torch | BSD | Language model support |
| transformers | Apache 2.0 | Handling the Phi-3 Mini model |
| accelerate | Apache 2.0 | Optimization of language models |
| safetensors | Apache 2.0 | Safe tensor storage |
| sentencepiece | Apache 2.0 | Text tokenization for language models |
| cryptography | Unknown | Encoding and hashing records |
All listed libraries are used in accordance with their licenses. Full texts are available on the project pages or in the respective repositories.
Archiwizator is distributed under the Apache 2.0 license. See the LICENSE file included with the application for details.
python -m venv venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows
pip install -r requirements.txt
pip install -e .[ocr,training]
cmake -S native_c -B native_c/build
cmake --build native_c/build --config Release
cd zig_modules/token_similarity
zig build -Drelease-safe
cd ../..
pytest
python build_exe.py
Optionally specify a different compiler, e.g.:
python build_exe.py --compiler clang++
Detailed guidelines can be found in CONTRIBUTING.md and the technical documentation Dokumentacja_Techniczna.md.
24 commits
4 commits
Python
91.7%
C++
3.3%
C
1.9%
Zig
1.1%