CommonForms
🪄 Automatically convert a PDF into a fillable form.
💻 Hosted Models (detect.semanticdocs.org) | 📄 CommonForms Paper | 🤗 Dataset | 🤗 FFDNet-L | 🤗 FFDNet-S
This repo contains three things:
- the pip-installable
commonformspackage, which has a CLI and API for converting PDFs into fillable forms - the FFDNet-S and FFDNet-L models from the paper CommonForms: A Large, Diverse Dataset for Form Field Detection
- the preprocessing code for the CommonForms dataset, which is hosted on HuggingFace: https://huggingface.co/datasets/jbarrow/CommonForms
Installation
CommonForms can be installed with either uv or pip, feel free to choose your package manager flavor:
uv pip install commonforms
Once it's installed, you should be able to run the CLI command on ~any PDF.
CommonForms CLI
The simplest usage will run inference on your CPU using the default suggested settings:
commonforms <input.pdf> <output.pdf>
| Input | Output |
|---|---|
Command Line Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
input |
Path | Required | Path to the input PDF file |
output |
Path | Required | Path to save the output PDF file |
--model |
str | FFDNet-L |
Model name (FFDNet-L/FFDNet-S) or path to custom .pt file |
--keep-existing-fields |
flag | False |
Keep existing form fields in the PDF |
--use-signature-fields |
flag | False |
Use signature fields instead of text fields for detected signatures |
--device |
str | cpu |
Device for inference (e.g., cpu, cuda, 0) |
--image-size |
int | 1600 |
Image size for inference |
--confidence |
float | 0.3 |
Confidence threshold for detection |
--fast |
flag | False |
If running on a CPU, you can trade off accuracy for speed and run in about half the time |
--multiline |
flag | False |
If you want the detected textboxes to allow multiline inputs |
CommonForms API
In addition to the CLI, you can use
from commonforms import prepare_form
prepare_form(
"path/to/input.pdf",
"path/to/output.pdf"
)
All of the above arguments are keyword arguments to the prepare_form function.
Dataset Prep
🚧 Code for dataset prep exists in the dataset folder.
Citation
If you use the tool, models, or code in an academic paper, please cite the CommonForms paper:
@misc{barrow2025commonforms,
title = {CommonForms: A Large, Diverse Dataset for Form Field Detection},
author = {Barrow, Joe},
year = {2025},
eprint = {2509.16506},
archivePrefix= {arXiv},
primaryClass = {cs.CV},
doi = {10.48550/arXiv.2509.16506},
url = {https://arxiv.org/abs/2509.16506}
}
If you use it in a non-academic setting, please reach out to the author (joseph.d.barrow [at] gmail.com)! I love to hear when people are using my work!
Metadata
Release files for commonforms 0.2.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 |
|---|---|---|---|---|
| commonforms-0.2.1.tar.gz | 9.8 kB | Without provenance | Details for commonforms-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| commonforms-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for commonforms-0.2.1-py3-none-any.whl |
Total release size: 19.5 kB
Release files / commonforms-0.2.1.tar.gz
| Download URL | commonforms-0.2.1.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0202a7e2b031a2c9fa73353ac90b6d3417d7298cecfd80950cb59bc6e94be2da
|
|
BLAKE2b-256 checksum How to use checksums |
b76f5440571eb7f13a900ef9322dc9259e4bc7157abff243aa355a5a235f1dc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.16
|
Release files / commonforms-0.2.1-py3-none-any.whl
| Download URL | commonforms-0.2.1-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04663c57a8db4aacb385704952f8fdc62288e63426b483d90f4ac5af0cc2d544
|
|
BLAKE2b-256 checksum How to use checksums |
b5467349d9686615711e761a05d1e9f6bba089b0aa6b00517b3e7590972c5368
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.16
|
Security for commonforms 0.2.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.