skillfed

types-fpdf2

Typing stubs for fpdf2

types-fpdf2 v2.8.4.20260724 763.0K downloads/30d#5,126 on PyPI37
Permissive license Apache-2.0 Active released

What it is and what it does

types-fpdf2 is a type stub package that provides type annotations for the fpdf2 PDF generation library. It allows static type checkers like mypy and pyright to validate code that uses fpdf2, catching type errors before runtime. The stubs are maintained as part of the typeshed project and were tested against mypy 2.3.0 and pyright 1.1.411.

This package is most useful for projects using fpdf2 versions before 2.8.6, which did not include built-in type annotations. For fpdf2 2.8.6 and later, the library itself provides type annotations, making this stub package unnecessary. The package has a single runtime dependency on Pillow and requires Python 3.10 or later.

Use it for:

  • Type-checking fpdf2 code in projects using mypy or pyright with fpdf2 versions before 2.8.6
  • Validating PDF generation logic in CI/CD pipelines that enforce strict type checking
  • Enabling IDE autocompletion and type hints for fpdf2 API calls during development
  • Migrating legacy fpdf2 code to a typed codebase without upgrading fpdf2 itself

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides type stubs for the fpdf2 PDF generation library, enabling static type checkers like mypy and pyright to validate code that uses fpdf2.

Yes, if you use fpdf2 versions before 2.8.6 and want static type checking. No, if you use fpdf2 2.8.6 or later—uninstall this package and rely on fpdf2's built-in annotations instead. The package is actively maintained, has no known vulnerabilities, and installs with minimal friction.

Install

types-fpdf2 on PyPI

pip

pip install types-fpdf2

uv

uv add types-fpdf2

poetry

poetry add types-fpdf2

Installing types-fpdf2

Before you install

Low install friction with a single runtime dependency on Pillow. Actively maintained as part of typeshed; released 21 days ago with no known vulnerabilities.

License in practice

Licensed under Apache-2.0 (permissive), allowing use in most projects without restriction.

Quickstart

pip install types-fpdf2

import fpdf2

pdf = fpdf2.FPDF()
pdf.add_page()
# Type checker now validates fpdf2 calls

Requires Python 3.10 or later. Note: fpdf2 version 2.8.6 and later include built-in type annotations, making this package redundant for those versions.

Verify before relying

  • Whether the stubs remain accurate for fpdf2 versions after 2.8.4, given that fpdf2 2.8.6+ includes its own annotations
  • Practical compatibility with fpdf2 versions between 2.8.4 and 2.8.6

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — Pillow
Maintenance actively maintained — 21 days since the last release
Last repo commit
First released
Downloads 762,952/month — #5,126 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: types_fpdf2-2.8.4.20260724-py3-none-any.whl

Programming Language :: Python :: 3Typing :: Stubs Only

Tags

type stubs fpdf2fpdf2 type hintstype checking pdf generationmypy fpdf2 annotationsstatic typing pdf library
type-stubsstatic-typing

More Software Development packages