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.
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
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.1
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 |
|---|---|---|---|---|
| womblex-0.6.1.tar.gz | 2.1 MB | With provenance | Details for womblex-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| womblex-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for womblex-0.6.1-py3-none-any.whl |
Total release size: 4.3 MB
Release files / womblex-0.6.1.tar.gz
| Download URL | womblex-0.6.1.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
920c1aa014ebbee9c73fa16b992ffdb62132d510b55cfa28e381282c9c8aeded
|
|
BLAKE2b-256 checksum How to use checksums |
1bddc9db59058eddde637fa2261e3139cf4e23c366ebb927780aed1fe806f26f
|
| 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 logRelease files / womblex-0.6.1-py3-none-any.whl
| Download URL | womblex-0.6.1-py3-none-any.whl |
|---|---|
| Size | 2.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70c0995e7ba29f08460346a84af13d6e297fdae0204b27c9e357d14393d99601
|
|
BLAKE2b-256 checksum How to use checksums |
eedb2ee0b11d739afe913c263c34d17fd99695141d952772f87b2929162d653f
|
| 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 logSecurity for womblex 0.6.1
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.
Attestation for womblex-0.6.1.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 logA 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.