npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agnamo/ocrstudio

v0.1.0

Published

Headless OCR pipeline CLI: turn images, PDFs, DOCX and text files into text or spreadsheets. Extracted from the OCR STUDIO workbench.

Readme

@agnamo/ocrstudio

Headless OCR pipeline CLI extracted from the OCR STUDIO workbench. It turns images, PDFs, DOCX files and plain text into text or spreadsheets — no picker, no plasma loader, just the OCR function behind a stable command line.

The package ships on npm, but the pipeline itself is Python. The npm bin is a thin launcher that finds a local Python 3.9+ interpreter and runs the bundled ocrstudio module, exactly like @agnamo/ldxv and @agnamo/ludvig.

Install

npm install -g @agnamo/ocrstudio

Python 3.9+ is required. The launcher probes py -3 / python / python3; set OCRSTUDIO_PYTHON to force a specific interpreter.

OCR backends

At least one backend is needed to produce text:

| backend | provides | install | |---|---|---| | Tesseract CLI | image + scanned-PDF OCR | winget install UB-Mannheim.TesseractOCR · apt install tesseract-ocr · brew install tesseract | | pytesseract | same, via Python | pip install pytesseract pillow | | PyMuPDF | PDF text layer and page rasterising | pip install pymupdf | | poppler | pdftoppm / pdftotext / pdfinfo fallbacks | apt install poppler-utils | | openpyxl | .xlsx output | pip install openpyxl |

engine=auto reads the PDF text layer first and only rasterises + OCRs pages whose text layer is empty or shorter than 40 characters.

ocrstudio --list-engines

Usage

ocrstudio .                                        # OCR everything under cwd
ocrstudio "C:\path\to\folder" --format csv
ocrstudio scan.pdf payslips/ --engine auto --out ./out --yes
ocrstudio . --format json --json > result.json     # machine-readable stdout

| flag | meaning | |---|---| | paths... | files or folders (default: current directory) | | --format, -f | dir text markdown csv tsv json xlsx | | --engine, -e | auto (default) · tesseract · text-layer | | --out, -o | output destination | | --dpi | raster DPI (default 300) | | --lang | tesseract language pack, e.g. eng or eng+deu | | --jobs | parallel workers (default: cores − 1, capped at 6) | | --yes, -y | accepted for compatibility; this CLI is always headless | | --json | print a machine-readable JSON result on stdout | | --list-engines | what is installed | | --version | print the version |

Output contract

stdout is data and stderr is presentation.

  • By default stdout is the single primary output path.
  • With --json, stdout is a JSON object: { ok, output, destination, engine, dpi, lang, stats }.
  • All banners, progress lines and the human summary go to stderr.

Exit codes: 0 success · 1 runtime/write error or pages with errors · 2 bad arguments or no OCR-able files.

The destination defaults to ocr-out-<YYYYmmdd-HHMMSS>/ next to the input. A run writes a .ocrstudio marker so a retry clears its own previous pages instead of mixing them with fresh ones; a folder holding unrelated files is never cleared.

  • dir — one .txt per page plus _manifest.json
  • text / markdown — single document, --- page N --- boundaries on multi-page sources
  • csv / tsv — one row per page; cells starting with = + - @ are prefixed with '
  • json — structured pages with text
  • xlsx — one row per page; pages longer than 30 000 characters continue on part rows

Development

npm run check       # node --check + python py_compile
npm test            # node --test smoke tests
npm run pack:check  # npm pack --dry-run

The Python package layout:

  • ocrstudio/engine.py — the extracted OCR function (page counting, tesseract/poppler/PyMuPDF drivers, process_unit)
  • ocrstudio/output.py — output format writers and destination safety
  • ocrstudio/cli.py — argument parsing and the headless runner
  • ocrstudio/util.py — file discovery and small helpers