types-fpdf2
Typing stubs for fpdf2
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-fpdf2uv
uv add types-fpdf2poetry
poetry add types-fpdf2Installing 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
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
types-docutilsProvides type hints for the docutils library,…
permissive · top 5,000 on PyPI
fpdf2fpdf2 generates PDF documents programmatically…
copyleft · top 5,000 on PyPI
types-pyflakesProvides type stubs for the pyflakes static…
permissive · top 15,000 on PyPI
types-psycopg2Provides type hints for psycopg2, enabling…
permissive · top 5,000 on PyPI
types-reportlabProvides type hints for the reportlab PDF…
permissive · top 15,000 on PyPI
types-mypy-extensionsProvides type stubs for mypy-extensions,…
permissive · top 15,000 on PyPI
types-httplib2Provides type stubs for the httplib2 HTTP…
permissive · top 5,000 on PyPI
types-boltonsProvides type stubs for the boltons library,…
permissive · top 15,000 on PyPI
types-oauthlibProvides type stubs for the oauthlib package,…
permissive · top 5,000 on PyPI
types-MarkdownProvides type stubs for the Markdown package,…
permissive · top 5,000 on PyPI