yushulx / python-mrz-scanner-sdk

Python MRZ scanner SDK built with Dynamsoft Label Recognizer
https://pypi.org/project/mrz-scanner-sdk/
MIT License
5 stars 0 forks source link

Add type defs? #3

Closed SimonSchick closed 3 weeks ago

SimonSchick commented 1 year ago

We rolled our own but it might be good for customers to have them shipped.

from cv2 import Mat

def initLicense(lic: str) -> None: ...
def createInstance() -> DynamsoftMrzReader: ...
def load_settings() -> str: ...

class MrzResult:
    text: str
    confidence: int
    x1: int
    x2: int
    x3: int
    x4: int
    y1: int
    y2: int
    y3: int
    y4: int

class DynamsoftMrzReader:
    def loadModel(self, model: str) -> None: ...
    def decodeFile(self, path: str) -> list[MrzResult]: ...
    def decodeMat(self, mat: Mat) -> list[MrzResult]: ...

See https://peps.python.org/pep-0561/

yushulx commented 1 year ago

@SimonSchick Thanks for your good suggestion. Would you like to submit a pull request? 😄

SimonSchick commented 1 year ago

Potentially, the issue is resolved for us and I have a ton of stuff on my plate, but you might want to make your API more accessible for other paying customers? :P