TRK FTZ OCR
TRK FTZ OCR is a lightweight OCR toolkit for extracting text from PDFs and folders of PDFs.
It supports single-page extraction, full PDF processing, directory processing, parallel execution, and multiple output formats.
🚀 Features
- 📄 Extract text from a single page
- 📚 Process full PDF files
- 📁 Process directories of PDFs
- ⚡ Parallel processing for speed
- 🧠 Adaptive OCR pipeline (PSM-based)
- 📊 Export results to:
- Dictionary (Python)
- TXT files (per page / per file)
- Excel (.xlsx)
📦 Installation
pip install trk-ftz-ocr
🖥️ CLI Usage
After installation, use:
trk-ftz-ocr --help
📄 Process a single PDF
Return text (default)
trk-ftz-ocr file.pdf --mode dict
Save as folder (per-page TXT files)
trk-ftz-ocr file.pdf --mode folder --output output/
Save as single Excel file
trk-ftz-ocr file.pdf --mode excel --output output.xlsx
📁 Process a directory
trk-ftz-ocr pdfs/ --mode folder --output output/
This creates:
output/
file1/
file1_page_1.txt
file1_page_2.txt
file2/
file2_page_1.txt
⚙️ Options
| Option | Description |
|---|---|
--page |
Extract a single page |
--output |
Output path (file or folder) |
--lang |
OCR language (default: ara) |
--zoom |
Render quality (default: 6) |
--parallel |
Enable parallel processing |
--mode |
Output mode: dict, file, folder, excel |
📊 Output Modes
dict
Returns Python dictionary:
{page_number: text}
file
Saves all text into a single .txt file.
folder
Saves each page as a separate .txt file.
excel
Saves results as:
file | page | text
🧠 Example (Python API)
from trk_ftz_ocr.pipeline import process
result = process(
path="file.pdf",
output_path="output/",
mode="dict",
parallel=True
)
print(result)
⚡ Performance
- Parallel page processing (ThreadPool)
- Parallel directory processing
- Lightweight preprocessing pipeline
- Adaptive OCR configuration
📌 Requirements
- Python >= 3.12
- Tesseract OCR installed on system
🛠️ Dependencies
- PyMuPDF
- pytesseract
- pillow
- tqdm
- pandas
- openpyxl
📄 License
MIT License
Metadata
Release files for trk-ftz-ocr 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| trk_ftz_ocr-0.1.0.tar.gz | 6.4 kB | Without provenance | Details for trk_ftz_ocr-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| trk_ftz_ocr-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for trk_ftz_ocr-0.1.0-py3-none-any.whl |
Total release size: 16.8 kB
Release files / trk_ftz_ocr-0.1.0.tar.gz
| Download URL | trk_ftz_ocr-0.1.0.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
850339f8eed3e30ea89efca2b94b671de8375a549d09ddb563e6cb8b4f739e50
|
|
BLAKE2b-256 checksum How to use checksums |
db1216d8e7acfcc088bc80b5db6aafb48bcc2155f2529cfed8a8620f80cb89b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / trk_ftz_ocr-0.1.0-py3-none-any.whl
| Download URL | trk_ftz_ocr-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ede7ccecff615acea65b19b101b394861e537420dca7114146afdf5cdb75e4d9
|
|
BLAKE2b-256 checksum How to use checksums |
a42235c95a5f0a7808adf991d95f0fdc6678ce0ab74eb34d1bfb6a3fd2db57cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for trk-ftz-ocr 0.1.0
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.