Skip to main content

ExtractForms

extractforms is a Python package and CLI to extract key/value fields from PDF forms.

Quickstart

uv sync --group dev
uv run pre-commit install
uv run ruff format .
uv run ruff check .
uv run ty check src tests
uv run pytest
uv run pre-commit run --all-files

CLI

extractforms extract --input form.pdf --output results/result.json --passes 2

Supported options include:

  • --no-cache
  • --dpi, --image-format, --page-start, --page-end, --max-pages
  • --chunk-pages
  • --backend (multimodal or ocr)
  • --drop-blank-pages, --blank-page-ink-threshold, --blank-page-near-white-level
  • --extra-instructions
  • --schema-id, --schema-path (expects *.schema.json), --match-schema

Schema fields support both kind and optional semantic_type metadata for richer typing (for example: phone, address, amount, iban, postal code).

Environment

Copy .env.template to .env and configure:

  • logging (LOG_LEVEL, LOG_JSON, LOG_FILE)
  • enterprise network/TLS (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY, CERT_PATH)
  • model endpoint (OPENAI_BASE_URL, OPENAI_API_KEY, OPENAI_MODEL)
  • backend selection (EXTRACTION_BACKEND, OCR_PROVIDER_FACTORY, OCR_ENABLE_TEXT_NORMALIZATION)
  • extraction behavior (DROP_BLANK_PAGES, BLANK_PAGE_INK_THRESHOLD, BLANK_PAGE_NEAR_WHITE_LEVEL)

Security notes:

  • OPENAI_BASE_URL must use https:// in non-local environments (http:// is accepted for localhost/loopback only).
  • --schema-path accepts only schema cache files with .schema.json suffix.

Project Layout

  • src/extractforms: package code
  • tests/unit: fast default tests
  • tests/integration: component-level tests
  • tests/end2end: user-facing behavior tests
  • skills: AI helper skills for coding workflows

Release

  1. Bump version in pyproject.toml.
  2. Create and push a git tag: vX.Y.Z.
  3. GitHub Action publishes to PyPI.

For manual validation, use workflow dispatch with publish_target=testpypi.

Metadata

Release files for extractforms 0.2.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 extractforms 0.2.0
File Size Uploaded
extractforms-0.2.0.tar.gz 34.8 kB Details

Built distribution (wheel)

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

Total release size: 79.1 kB

Release files / extractforms-0.2.0.tar.gz

Download URL extractforms-0.2.0.tar.gz
Size 34.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5e15df0b81aab698e92eb58c986135f8e02c2a42c93a75671f69d5ff1816d9b2
BLAKE2b-256 checksum
How to use checksums
76770e6ac3ca7e0bd2a9d9fa6386c91f9df9b68fdcb0b2f0801ecdb68ce37e43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 21, 2026.

Transparency log

Release files / extractforms-0.2.0-py3-none-any.whl

Download URL extractforms-0.2.0-py3-none-any.whl
Size 44.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b640a8f0e3afbfcbffc5f1e04f79d94e3203934375f925818128f0f4fb1e3e7
BLAKE2b-256 checksum
How to use checksums
1bbadafd9c84891d1c09e49207b0225dfbf6dd6116b85bdfdb114a94d46af1da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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