Skip to main content

A python project to turn scanned forms into a list of key-value pairs.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

extractforms-0.2.0.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

extractforms-0.2.0-py3-none-any.whl (44.4 kB view details)

Uploaded Python 3

File details

Details for the file extractforms-0.2.0.tar.gz.

File metadata

  • Download URL: extractforms-0.2.0.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for extractforms-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5e15df0b81aab698e92eb58c986135f8e02c2a42c93a75671f69d5ff1816d9b2
MD5 1b9eed1161e9df8c15f46abb0d29e9e5
BLAKE2b-256 76770e6ac3ca7e0bd2a9d9fa6386c91f9df9b68fdcb0b2f0801ecdb68ce37e43

See more details on using hashes here.

Provenance

The following attestation bundles were made for extractforms-0.2.0.tar.gz:

Publisher: release.yml on Guillaume-Lombardo/extractforms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file extractforms-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: extractforms-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 44.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for extractforms-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b640a8f0e3afbfcbffc5f1e04f79d94e3203934375f925818128f0f4fb1e3e7
MD5 46a6c44c2a9ee317337b6666256a703f
BLAKE2b-256 1bbadafd9c84891d1c09e49207b0225dfbf6dd6116b85bdfdb114a94d46af1da

See more details on using hashes here.

Provenance

The following attestation bundles were made for extractforms-0.2.0-py3-none-any.whl:

Publisher: release.yml on Guillaume-Lombardo/extractforms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page