发票的格式为PDF,初步想法是提取PDF的内容并转换为文本,查找资料,找到三个符合的Python package: PDFMiner , pdfminer3k和Pdfminer.six。
PDFMiner
官方描述:
PDFMiner is a text extraction tool for PDF documents.
Warning: As of 2020, PDFMiner is not actively maintained. The code still works, but this project is largely dormant. For the active project, check out its fork pdfminer.six.
意思是说,PDFMiner 是一个从PDF文档中提取文本的工具。从2020年开始,基本不再维护,可以转向Pdfminer.six。
pdfminer3k
官方描述:
pdfminer3k is a Python 3 port of pdfminer. PDFMiner is a tool for extracting information from PDF documents. Unlike other PDF-related tools, it focuses entirely on getting and analyzing text data. PDFMiner allows to obtain the exact location of texts in a page, as well as other information such as fonts or lines. I