Registry / serialization / pypdfform

pypdfform

JSON →
library5.2.1pypypi✓ verified 84d ago

PyPDFForm is a Python library for programmatically filling, flattening, and manipulating PDF forms (AcroForms, XFA, etc.). Current version is 4.8.2, with active development and frequent releases (multiple versions per month). It supports Python >=3.10 and provides both a Python API and a CLI.

pip install pypdfform
INSTALL
IMPORT
SIG · PYPDFFORM
P
pypdfform
serializationpythonv5.2.1
Install
6.3s avg
Import
—
Disk
109MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v5.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 117.1MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 6.3s · import 0.000s · 115MB
109MB installed
● package 109MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PdfWrapper
✓ from PyPDFForm import PdfWrapper
✗ from pypdfform import PdfWrapper

Basic usage: open a template PDF, set form field values, and write output. Use flatten() to make fields non-editable.

from pypdfform import PdfWrapper # Fill a PDF form with open('template.pdf', 'rb') as f: pdf = PdfWrapper(f) pdf['field_name'] = 'value' with open('output.pdf', 'wb') as f: f.write(pdf.read()) # Flatten the form (remove interactivity) pdf.flatten() with open('output_flattened.pdf', 'wb') as f: f.write(pdf.read())
pypdfform --version
Debug
Known issues
breakingIn v4.7.6 - v4.7.8, the internal package structure changed, moving source to lib/. Import paths from pypdfform remain the same, but if you relied on internal modules like pypdfform.egress or pypdfform.template, those imports will break. Use public API methods instead.
fix
Use from pypdfform import PdfWrapper and avoid importing internal modules directly.
affects: >=4.7.6, <4.7.9
deprecatedPdfWrapper.update_widget_key.defer parameter is deprecated since v4.7.7. It will be removed in a future version.
fix
Remove defer parameter usage. If you need deferred operations, use the main update_field method without defer.
affects: >=4.7.7
gotchaWhen filling checkboxes or radio buttons, use the field's export value (e.g., 'Yes' or 'On'), not a boolean True.
fix
Check the widget's appearance dictionary; typically set pdf['checkbox_field'] = 'Yes' or pdf['radio_field'] = 'Choice1'.
affects: all
Upgrade
Version history
5.2.1latest on PyPI · released Jun 14, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
pypdfform — pip install pypdfform · libregistry