Skip to content

Commit

Permalink
Merge pull request #40 from jandom/jandom/feat/add-pytyped
Browse files Browse the repository at this point in the history
feat: add py.typed
  • Loading branch information
Eric-Canas authored Sep 7, 2024
2 parents f127159 + c9d92e6 commit fdda2ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 5 additions & 2 deletions src/qreader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Empty file added src/qreader/py.typed
Empty file.

0 comments on commit fdda2ac

Please sign in to comment.