diff --git a/setup.py b/setup.py index 9f3b8be..1abb5c8 100644 --- a/setup.py +++ b/setup.py @@ -7,6 +7,8 @@ package_dir={"": "src"}, # expose qreader.py as the unique module py_modules=["qreader"], + # include py.typed file in the distribution + package_data={"qreader": ["src/qreader/py.typed"]}, url="https://github.com/Eric-Canas/qreader", license="MIT", author="Eric Canas", diff --git a/src/qreader/__init__.py b/src/qreader/__init__.py index cafa3eb..a9af241 100644 --- a/src/qreader/__init__.py +++ b/src/qreader/__init__.py @@ -196,9 +196,12 @@ def decode( def detect_and_decode( self, image: np.ndarray, return_detections: bool = False, is_bgr: bool = False - ) -> typing.Tuple[ + ) -> typing.Union[ + typing.Tuple[ + typing.Tuple[str | None, ...], + tuple[dict[str, np.ndarray | float | tuple[float | int, float | int]]] | None, + ], typing.Tuple[str | None, ...], - tuple[dict[str, np.ndarray | float | tuple[float | int, float | int]]] | None, ]: """ This method will decode the **QR** codes in the given image and return the decoded strings diff --git a/src/qreader/py.typed b/src/qreader/py.typed new file mode 100644 index 0000000..e69de29