From 7a53d57455e2cd1797034966730c6721008c0c35 Mon Sep 17 00:00:00 2001 From: Zelray <163726380+Zelray@users.noreply.github.com> Date: Tue, 16 Jun 2026 22:38:27 -0400 Subject: [PATCH 1/2] fix: correct --help output and drop debug print Escape the percent in the --fast help string (50% -> 50%%) so argparse stops treating it as a format specifier and dumping the raw argument dict on 'commonforms --help'. Also remove a stray debug print that echoed args.confidence to stdout on every invocation. --- commonforms/__main__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commonforms/__main__.py b/commonforms/__main__.py index 08be6a6..f7b13dd 100644 --- a/commonforms/__main__.py +++ b/commonforms/__main__.py @@ -48,7 +48,7 @@ def main(): parser.add_argument( "--fast", action="store_true", - help="If running on a CPU, you can use --fast to get a 50% speedup with a small accuracy penalty", + help="If running on a CPU, you can use --fast to get a 50%% speedup with a small accuracy penalty", ) parser.add_argument( "--multiline", @@ -58,7 +58,6 @@ def main(): args = parser.parse_args() - print(f"**{args.confidence=}") prepare_form( args.input, args.output, From 76c99c58587c4b71118e3d3b575a7cd5c2ed2bb9 Mon Sep 17 00:00:00 2001 From: Zelray <163726380+Zelray@users.noreply.github.com> Date: Tue, 16 Jun 2026 22:38:27 -0400 Subject: [PATCH 2/2] docs: recommend isolated install to avoid env pollution Lead the Installation section with uv tool install / pipx, which create a dedicated env and expose only the commonforms command. The dependency set (transformers, torch, rfdetr, ultralytics) is large and pins recent versions, so a plain pip install into a shared env can upgrade numpy/pillow/transformers in place and break other tooling. Keep uv pip / pip documented for in-project library use, with a caution about the active environment. --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9da9527..ca70242 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,31 @@ This repo contains three things: ## Installation -CommonForms can be installed with either `uv` or `pip`, feel free to choose your package manager flavor: +CommonForms is a CLI tool with a sizable dependency footprint (`transformers`, +`torch`, `rfdetr`, `ultralytics`, and friends), so the cleanest install is an +**isolated** one that creates a dedicated environment and exposes just the +`commonforms` command: + +```sh +uv tool install commonforms +# or +pipx install commonforms +``` + +If you'd rather use it as a **library** inside an existing project, install it with +`uv` or `pip`, feel free to choose your package manager flavor: ```sh uv pip install commonforms +# or +pip install commonforms ``` +> ⚠️ A plain `pip install` (or `uv pip install`) installs into your **active** +> environment. Because the dependency set is large and pins recent versions, this can +> upgrade packages like `numpy`, `pillow`, and `transformers` in place — so install +> into a dedicated virtualenv/conda env, not a shared `base`. + Once it's installed, you should be able to run the CLI command on ~any PDF. ## CommonForms CLI