OCR

Document recognition gateway for other modules: DSL library functions (extract, extractProfile, summary, raw) that send a file to the OCR service a tenant chooses once, here — the platform's own or an external one.

Try it in your workspacefree workspace · you confirm before anything installs

v0.1.1 · 6 installs · free

What it does

OCR is the one place where a workspace chooses how scanned documents are read. It has no screens, tables or buttons of its own. It gives other modules functions that send a file to a recognition service and return the fields, a summary or the raw text. Which service to use is a single setting here, so the modules that read documents do not each carry an address.


Highlights

  • One setting for the service — platform is the server's own OCR service. Any other value is the base URL of an external service that speaks the same /extract contract.
  • Per-folder routing — the setting can differ by folder, so one department's documents can go elsewhere.
  • Fields by schema — ask for named fields with a type and a description each.
  • Fields by profile — use an extraction profile a module ships and name it in full, such as proc.bill_of_lading.
  • Summary and raw text — get a short summary of a general document, or everything read without a schema as a first pass.
  • Failures you can store — functions never throw. They return ok, data and error, so an action can mark a record failed instead of rolling back.

Functions

Function data on success Notes
extract(file, schema) { fields, confidence?, unmatched, raw_text, meta } schema is { name: { type, description } }
extractProfile(file, profile) same as extract profile must be 'module_cd.profile_cd'
summary(file) { summary, raw_text, meta } For general documents
raw(file) { raw_text, containers, bl_numbers, invoice_numbers, dates, ... } Everything read without a schema
endpoint() the endpoint in use For display or logging

Every function except endpoint() returns { ok, data, error }.

execute:
	var r = ocr.extractProfile([doc_file], 'proc.bill_of_lading')
	if (r.ok) {
		[bl_no] = r.data.fields.bl_no
		[status] = 'recognized'
	} else {
		[status] = 'failed'
		[error_text] = r.error
	}

Profiles are named in full because the function runs as the OCR module and cannot see the caller's short names. A short name is refused. A module lists the functions it needs in its own deps/ocr.json.

Setup

  1. Install the module.
  2. Leave endpoint at platform, or set it to an external service's base URL.

The platform value needs a server with its OCR service configured. Without one, every call returns ok: false with an error saying so.

How it fits

Modules that read documents, such as a procurement or import workspace, call it and keep their own extraction profiles.

Used by

Published modules that build on this one.

OCR
Try it
/ explore more

Browse the full
module catalog.

Every module is metadata — install it in one click, then change anything.