Getting NotImplementedError文件使用python pdftables从pdf获取表数据
我使用PythonPDFTables从pdf中获取表数据,并按照git中给出的说明进行操作 但是当我运行代码时Getting NotImplementedError文件使用python pdftables从pdf获取表数据,python,pdf,Python,Pdf,我使用PythonPDFTables从pdf中获取表数据,并按照git中给出的说明进行操作 但是当我运行代码时 filepath = 'tests.pdf' fileobj = open(filepath,'rb') from pdftables.pdf_document import PDFDocument doc = PDFDocument.from_fileobj(fileobj) 我得到这样的错误 File "<stdin>", line 1, in <
filepath = 'tests.pdf'
fileobj = open(filepath,'rb')
from pdftables.pdf_document import PDFDocument
doc = PDFDocument.from_fileobj(fileobj)
我得到这样的错误
File "<stdin>", line 1, in <module>
File "pdftables/pdf_document.py", line 53, in from_fileobj
raise NotImplementedError
文件“”,第1行,在
文件“pdftables/pdf_document.py”,第53行,from_fileobj
引发未实现的错误
有人能帮我解决这个问题吗如果您查看从_fileobj函数实现,您可以看到以下注释:
# TODO(pwaller): For now, put fh into a temporary file and call
# .from_path. Future: when we have a working stream input function for
# poppler, use that.
如果我理解正确,您应该使用from_path
函数,因为from_fileobj
尚未实现。使用当前代码很容易做到这一点:
filepath = 'tests.pdf'
from pdftables.pdf_document import PDFDocument
doc = PDFDocument.from_path(filepath)