Metadata-Version: 2.4
Name: pymupdf-stubs
Version: 1.27.2.2.post1
Summary: Type stubs for PyMuPDF (fitz), automatically generated
Project-URL: Homepage, https://github.com/elohmeier/pymupdf-stubs
Project-URL: Repository, https://github.com/elohmeier/pymupdf-stubs
Project-URL: Issues, https://github.com/elohmeier/pymupdf-stubs/issues
Project-URL: PyMuPDF, https://github.com/pymupdf/PyMuPDF
Author-email: Enno Richter <enno@nerdworks.de>
License: Apache-2.0
License-File: LICENSE
Keywords: fitz,mupdf,mypy,pdf,pymupdf,stubs,type hints,typing
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Classifier: Typing :: Stubs Only
Requires-Python: >=3.12
Requires-Dist: pymupdf<1.28.0,>=1.27.0
Description-Content-Type: text/markdown

# pymupdf-stubs

[![PyPI](https://img.shields.io/pypi/v/pymupdf-stubs.svg)](https://pypi.org/project/pymupdf-stubs/)
[![Changelog](https://img.shields.io/github/v/release/elohmeier/pymupdf-stubs?include_prereleases&label=changelog)](https://github.com/elohmeier/pymupdf-stubs/releases)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/elohmeier/pymupdf-stubs/blob/master/LICENSE)

Type stubs for [PyMuPDF](https://github.com/pymupdf/PyMuPDF) (`pymupdf` / `fitz`), published as a PEP 561 stub-only package.

## Installation

```bash
pip install -U pymupdf-stubs
```

This package targets current PyMuPDF releases.

## Usage

No runtime code changes are required. Install stubs and run your type checker.

```python
import pymupdf
import fitz

doc = pymupdf.Document()
page = doc[0]
drawings = page.get_drawings()
```

## Type Checking

This repository validates stubs with:

```bash
uv run ty check
```

## Compatibility Notes

- `fitz` is supported as a compatibility re-export of `pymupdf`.
- Some highly dynamic APIs may still be typed as `Any` or broad dictionary shapes.
- If a PyMuPDF API is missing or incorrect, please open an issue.

## Contributing

Issues and PRs are welcome: <https://github.com/elohmeier/pymupdf-stubs/issues>
