Skip to main content

Womblex

Womblex turns messy government document releases (FOI bundles, scanned forms, printed spreadsheets) into a verbatim, versioned Parquet corpus you can search, analyse and trace back to its source.

CI PyPI Python 3.12 Licence: Apache-2.0

pip install womblex          # Python 3.12

Extract a redacted decision notice (a synthetic document from this repository's test set):

curl -LO https://raw.githubusercontent.com/DeepCivic/womblex/main/fixtures/synthetic/documents/quokka-care-decision-notice_redacted.pdf
womblex extract quokka-care-decision-notice_redacted.pdf -o out/

out/quokka-care-decision-notice_redacted.txt (4,012 characters) begins:

Notice of Administrative Decision

Quokka Cove Out of School Hours Care
Service approval number: SE-40099001 Provider approval number: PR-00099017
Approved provider: Rottnest Community Services Incorporated
Address: 1 Thomson Bay Road, ROTTNEST, WA 6161
The Regulatory Authority has decided to issue a compliance direction to the approved
provider under the Wildlife Care Services National Law.

See examples/ for an end-to-end walkthrough.

What it does

Government document releases (FOI bundles, papers, scanned forms, printed spreadsheets) are hard to get text out of without losing key details. Womblex extracts it first and keeps it verbatim, as an ordered stream of paragraphs, headings, tables and forms. Independent stages then clean, chunk, annotate, enrich and mask the corpus, each writing its own sidecar beside the extraction output, so every derived row points back at the source it came from.

It runs on a laptop with no network access, and the same code scales out to a fleet of workers.

Features

  • Page-level routing for PDFs and images. Every page is profiled and routed on its own signals (native text, OCR, tables, forms, a spreadsheet printed to PDF), so a bundle mixing a cover letter, a scanned form and a printed table is handled page by page.
  • Word, Markdown and spreadsheets read natively, in document order; spreadsheets become a cell-grained stream with header detection.
  • Composable downstream stages — normalise, spellfix, redact, chunk, money, enrich, graph-refresh, embed, link, pii, quality — each reading the shards, writing a sidecar and checkpointing independently.
  • Evidence on every annotation. Money, entity-link and PII rows carry a reference to the element, page and character span they came from, labelled with whether it was checked.
  • Swappable models. OCR, layout, PII context, tokeniser, dictionary, enrichment and embedding are named slots; a package can register its own model through an entry point, with no schema change. The default set is CPU-only.
  • Provenance in the files. Every Parquet footer records its contract version and sensitivity; a run's files also record the run, version, config digest and the model that filled each slot.
  • Reference registers. G-NAF, the ABN bulk extract and shapefiles have their own ingests to typed Parquet or GeoParquet.

Installation

Requires Python 3.12 (the OCR engine, rapidocr-onnxruntime, does not install on 3.13).

pip install womblex          # the whole pipeline, CPU-only
pip install womblex[api]     # + the /v1 service API (womblex serve)
pip install womblex[pgvector] # + a workflow's Postgres destination (pgvector)

The wheel ships only the small model artefacts. The larger local models (PaddleOCR v5, PP-DocLayout-M, the PII context model) are resolved from WOMBLEX_MODELS_DIR, or from src/womblex/_models/ and models/ in a source checkout; without PP-DocLayout-M the pre-run model check stops womblex run. Every model, and how to connect a hosted one, is in docs/models.md.

Quick start

# One file, to text or Parquet
womblex extract report.pdf -o output/
womblex extract register.xlsx -o output/ --format parquet

# A corpus described by a config: copy configs/example.yaml and set paths.input_root
womblex run --config my-dataset.yaml            # add --resume to continue after a failure

womblex run does extraction only. Every other stage is its own command over the run's shard directory:

SHARDS=<output_root>/<run_id>/documents
womblex normalise --shards $SHARDS
womblex chunk     --shards $SHARDS --config my-dataset.yaml
womblex money     --shards $SHARDS
womblex manifest  --shards $SHARDS     # rebuild the run-level manifest.parquet

configs/default-isaacus.yaml is the reference full pipeline, with the command sequence and the reason for each setting commented inside it. With AI chunking on, run enrich before chunk, so chunking reuses the enrichment instead of paying for it twice. Dataset-specific settings belong in config, never in code.

To publish a sample run into a run root:

womblex seed-demo --output-root runs/   # publishes run-synthetic-demo

Commands

womblex <command> --help lists each command's options.

Command Purpose
extract, run Extract one file; extract a corpus from a config
normalise, spellfix, redact, chunk, money, enrich, graph-refresh, embed, link, pii, quality Downstream stages over a shard directory
manifest Rebuild the run manifest (--lineage OUT: also as an OpenLineage RunEvent)
ingest-gnaf, ingest-abn, ingest-geo Reference-register ingests
verify-shards Audit a run's shard files; optionally diff two runs
verify-evidence Re-check every money, entity-link and PII span against the source text it points at
resolve-source Map output rows back to their source files, verified by content hash
egress Export a finished run as a bundle
enqueue, worker, jobs, finalize, run-stage, enqueue-stages Distributed runs over object storage and the job queue
retry-stage Retry a failed distributed stage from its first failed unit
run-workflow, validate, plan Run a workflow file's steps over a local shard directory; check it would run, without running it; count what its paid steps would send, calling nothing
dispatch-workflow, schedule-workflow Queue a workflow file's steps for the fleet; store its copy and schedule its cron triggers for workers to fire
rerun-collection Run a workflow file's steps over its whole collection; unchanged published units are skipped
add-to-collection, remove-workflow Fire a stored workflow once now, adding its input prefix's new documents to its collection; remove a workflow's schedules and stored copy (its run and shards stay)
deliver Deliver a finished run to its workflow file's destinations again, replacing what was delivered
validate-redactions Validate the redaction detector against a labels packet (annotate-redactions is a deprecated alias of redact --shards --pdfs)
ground-truth, score Build review baselines from a run, and score corrected ones
profile Print the inferred column schema of a tabular file
api-token, serve Mint service tokens; run the service API
seed-demo Publish the demo run into a run root or store

Integrating with Womblex

Other software integrates in one of two ways.

The /v1 service API. womblex serve is an authenticated HTTP API over a store, a job queue and an ingest location. A client uploads documents, submits a run, polls it and reads results back; runs are owner-scoped, so a client sees only its own. Workers do the processing; the API only writes queue rows and reads output. Everything an operator interface needs is a call here too (composing and validating a config, presets, ingest previews, a run's stage presence, chunk detail, logs and progress, the queue, the deployment's resources), so a user interface is a renderer over the API.

womblex api-token --client my-app --scope submit --scope read   # token shown once, plus its registry entry
WOMBLEX_API_CLIENTS=clients.yaml womblex serve --store <uri> --dsn <dsn> --ingest <uri>   # 127.0.0.1:8081

H="Authorization: Bearer $TOKEN"
curl -H "$H" -F files=@report.pdf http://localhost:8081/v1/uploads          # returns input_prefix
curl -H "$H" -H "Content-Type: application/json" \
     -d '{"input_prefix": "<input_prefix>"}' http://localhost:8081/v1/runs  # returns the run id
curl -H "$H" http://localhost:8081/v1/runs/<run_id>                         # pending, running, done, failed or cancelled
curl -H "$H" "http://localhost:8081/v1/runs/<run_id>/documents/<source_hash>/text"   # masked layer by default

Scopes, ownership, text layers and error codes are in docs/service-api.md.

The Parquet data contract. A consumer can read a run's Parquet directly, or receive it as an egress bundle (womblex egress <run> --to <dest>). Every file's footer carries a contract version and a sensitivity (raw, masked or none); only masked and none are safe to pass beyond your trust boundary. The rules are in docs/contract.md, the schemas in docs/extraction.md and the bundle in docs/egress.md. In Python, womblex.__all__ is the stable surface.

Documentation

The API reference covers every public module, generated from its docstrings. Build it with uv run --group docs mkdocs serve (CI builds it on every PR).

Document Covers
functional_requirements.md What Womblex must do
architecture.md, project-structure.md How it is built, and where each thing lives
dataflow.md, composable-design.md How data moves between stages, and the stage contracts
extraction.md, contract.md The output schema and the consumer contract
service-api.md, egress.md The /v1 service API, and the egress bundle
models.md, model-plugins.md Every model, connecting hosted providers, and plugging in your own
workflows.md Workflow files: what they hold, and how they are checked, run, dispatched and scheduled
layout.md Layout settings and the layout_regions sidecar
money-extraction.md The money annotation
evaluation.md, accuracy/ Evaluation metrics, and benchmark reports generated by womblex-benchmark
heuristics_disambiguation.md The CV2 and NumPy heuristics used in detection
deployment-images.md Docker Compose services and their images
decisions.md Why things are the way they are, and dead ends not to retry
steering.md, CHANGELOG.md What's next, and what has shipped

Project status

Womblex is alpha and pre-1.0.

  • Stable: the on-disk data contract, versioned apart from the package (additive changes are minor bumps with back-fill; renames are major bumps with a reader shim), and the Python names in womblex.__all__, which change only after one minor release of deprecation warnings. See STABILITY.md for the policy and docs/contract.md for the schema.
  • Moving: everything outside __all__, the CLI options, the stored-workflow commands.

Contributing

See CONTRIBUTING.md for how to branch, check and open a pull request, and STABILITY.md for what may change between releases.

git clone https://github.com/DeepCivic/womblex.git && cd womblex
uv sync --extra dev --extra api

uv run ruff check src/ tests/
uv run mypy src/
uv run python -m pytest tests/ -v -m "not benchmark"               # what CI runs
uv run python -m pytest tests/ -v -m "not slow and not benchmark"  # fast subset

All three are the CI gate. The suite reads only the synthetic fixtures in fixtures/synthetic/, so a bare clone runs it; tests that need a paid API key or a Postgres DSN skip without one. Install the commit hook (secret scan and the semgrep rules in .semgrep/rules/) with pip install pre-commit==4.6.1 && pre-commit install. Conventions — file and merge size caps, what belongs in core — are in CLAUDE.md; third-party data policy is in THIRD_PARTY_DATA.md.

Licence

Apache-2.0.

Acknowledgements

Womblex is a thin layer over mature libraries, including pypdfium2 and pdfplumber (PDF), RapidOCR running PaddleOCR ONNX models (OCR), PP-DocLayout (layout), semchunk (chunking), Presidio (PII replacement), DBOS (workflows), and python-docx, pandas and openpyxl (Office formats).

Metadata

Release files for womblex 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for womblex 0.6.0
File Size Uploaded Provenance Actions
womblex-0.6.0.tar.gz 2.1 MB With provenance Details for womblex-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for womblex 0.6.0
File Interpreter ABI Platform Actions
womblex-0.6.0-py3-none-any.whl Python 3 none any Details for womblex-0.6.0-py3-none-any.whl

Total release size: 4.3 MB

Release files / womblex-0.6.0.tar.gz

Download URL womblex-0.6.0.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
c55b4263510c63738838ce297bceeb14b033a649d91e07f737d394704fa0a3e6
BLAKE2b-256 checksum
How to use checksums
81e9c6ebfe592ee574343be889737b3cf25de7981c74fb79878cff1530bf83a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / womblex-0.6.0-py3-none-any.whl

Download URL womblex-0.6.0-py3-none-any.whl
Size 2.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
25ee042d9ca6956238b83d9164475af61e52e66b696ff1b232786f11331e3f1a
BLAKE2b-256 checksum
How to use checksums
cfca6bd09bf77df1e4d14e3cddc25dc2a432fa834a70584b76b53f5b100e6ace
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for womblex 0.6.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for womblex-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page