Skip to main content

The Python library & CLI for PDF forms.

Project description

PDF Form Automation Simplified - Create, Inspect, Style, and Fill Forms in Python or from the Command Line.

Introduction

PyPDFForm is a Python library and command line tool for working with PDF forms. It provides Python APIs and CLI commands for creating, inspecting, updating, and filling forms, plus common PDF utilities.

With PyPDFForm, you can:

  • Create PDF forms, form fields, and raw elements.
  • Inspect form fields, metadata, and values.
  • Update field styling, behavior, and scripts.
  • Fill PDF forms.
  • Extract pages and merge PDFs.

The goal is to make PDF form work straightforward, whether you are handling one document or building a larger workflow.

Installing

To use PyPDFForm as a Python library, install the base package with pip:

pip install PyPDFForm

To use the CLI, install PyPDFForm with the cli extra using pipx:

pipx install "PyPDFForm[cli]"

Quick Example

Check out the GitHub repository for a live demo if you can't see it here.

The GIF above shows the CLI filling a PDF form. To try the same workflow with the Python library, download the sample PDF form and run:

from PyPDFForm import PdfWrapper

filled = PdfWrapper("sample_template.pdf", need_appearances=True).fill(
    {
        "test": "test_1",
        "check": True,
        "test_2": "test_2",
        "check_2": False,
        "test_3": "test_3",
        "check_3": True,
    },
)

filled.write("output.pdf")

After running this snippet, output.pdf will be written to the location you specified and should look like this.

Documentation

The official documentation can be found on the GitHub page of this repository.

Other Resources

Star History

This project is maintained entirely in my spare time. If you like the project please consider starring the GitHub repository. It is the best way to keep me motivated and continue making the project better.

Star History Chart

Project details


Release history Release notifications | RSS feed

This version

5.2.4

Download files

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

Source Distribution

pypdfform-5.2.4.tar.gz (153.1 kB view details)

Uploaded Source

Built Distribution

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

pypdfform-5.2.4-py3-none-any.whl (168.2 kB view details)

Uploaded Python 3

File details

Details for the file pypdfform-5.2.4.tar.gz.

File metadata

  • Download URL: pypdfform-5.2.4.tar.gz
  • Upload date:
  • Size: 153.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pypdfform-5.2.4.tar.gz
Algorithm Hash digest
SHA256 9c8a963062dc7ae059b03ac419d5423c52d663af92a4860e1911db9cf12e0f97
MD5 493d93a89bda10016be857a6be0b6f28
BLAKE2b-256 c243e2550db5cf9ad2b7b8589a02a0feb3fded025d142953aa5a0a2828ee82d8

See more details on using hashes here.

File details

Details for the file pypdfform-5.2.4-py3-none-any.whl.

File metadata

  • Download URL: pypdfform-5.2.4-py3-none-any.whl
  • Upload date:
  • Size: 168.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pypdfform-5.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fba3128f3252f2942a7e9c07faf7c918e8580693f8d515a5ecfffbd44580f37c
MD5 321e51c057b477decd0c94bf1d5b8290
BLAKE2b-256 f99b3f2dc173bb7b3f5919691780817427f4a2b34272f37c760790a17c31af66

See more details on using hashes here.

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