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(multimodalorocr)--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_URLmust usehttps://in non-local environments (http://is accepted for localhost/loopback only).--schema-pathaccepts only schema cache files with.schema.jsonsuffix.
Project Layout
src/extractforms: package codetests/unit: fast default teststests/integration: component-level teststests/end2end: user-facing behavior testsskills: AI helper skills for coding workflows
Release
- Bump
versioninpyproject.toml. - Create and push a git tag:
vX.Y.Z. - GitHub Action publishes to PyPI.
For manual validation, use workflow dispatch with publish_target=testpypi.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e15df0b81aab698e92eb58c986135f8e02c2a42c93a75671f69d5ff1816d9b2
|
|
| MD5 |
1b9eed1161e9df8c15f46abb0d29e9e5
|
|
| BLAKE2b-256 |
76770e6ac3ca7e0bd2a9d9fa6386c91f9df9b68fdcb0b2f0801ecdb68ce37e43
|
Provenance
The following attestation bundles were made for extractforms-0.2.0.tar.gz:
Publisher:
release.yml on Guillaume-Lombardo/extractforms
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
extractforms-0.2.0.tar.gz -
Subject digest:
5e15df0b81aab698e92eb58c986135f8e02c2a42c93a75671f69d5ff1816d9b2 - Sigstore transparency entry: 976098704
- Sigstore integration time:
-
Permalink:
Guillaume-Lombardo/extractforms@86219ae6062139094364ddec11c72ae1b0dbc9f1 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Guillaume-Lombardo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@86219ae6062139094364ddec11c72ae1b0dbc9f1 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b640a8f0e3afbfcbffc5f1e04f79d94e3203934375f925818128f0f4fb1e3e7
|
|
| MD5 |
46a6c44c2a9ee317337b6666256a703f
|
|
| BLAKE2b-256 |
1bbadafd9c84891d1c09e49207b0225dfbf6dd6116b85bdfdb114a94d46af1da
|
Provenance
The following attestation bundles were made for extractforms-0.2.0-py3-none-any.whl:
Publisher:
release.yml on Guillaume-Lombardo/extractforms
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
extractforms-0.2.0-py3-none-any.whl -
Subject digest:
2b640a8f0e3afbfcbffc5f1e04f79d94e3203934375f925818128f0f4fb1e3e7 - Sigstore transparency entry: 976098707
- Sigstore integration time:
-
Permalink:
Guillaume-Lombardo/extractforms@86219ae6062139094364ddec11c72ae1b0dbc9f1 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Guillaume-Lombardo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@86219ae6062139094364ddec11c72ae1b0dbc9f1 -
Trigger Event:
release
-
Statement type: