def text_extract(path, password=None):
    """Extract text from a PDF file"""
    pdf = Info(path, password).pdf

    return [pdf.getPage(i).extractText() for i in range(pdf.getNumPages())]
Extract text from a PDF file