pymupdf / PyMuPDF

PyMuPDF is a high performance Python library for data extraction, analysis, conversion & manipulation of PDF (and other) documents.
https://pymupdf.readthedocs.io
GNU Affero General Public License v3.0
4.66k stars 460 forks source link

Request: adding type hints #3361

Open jamesbraza opened 3 months ago

jamesbraza commented 3 months ago

Is your feature request related to a problem? Please describe.

Running mypy==1.9.0 with PyMuPDF==1.24.1:

foo.py:12:1: error: Skipping analyzing "fitz": module is installed, but missing library stubs or py.typed marker  [import-untyped]
    import fitz
    ^

Describe the solution you'd like

It would be nice to:

Describe alternatives you've considered

N/a

Additional context

Thank you in advance 👍

julian-smith-artifex-com commented 3 months ago

We are looking at possible architectural changes that will allow better type hints in future. But it's quite an involved process so there are no timescales at the moment.

JorjMcKie commented 3 months ago

Duplicate of #2883.