2017-08-14 6 views
1

のpython pdftablesを使用してPDFからテーブルデータをフェッチNotImplementedErrorファイルを取得し、gitのは、私は、PDFからテーブルデータをフェッチするためにPythonのpdftablesを使用しています

https://github.com/drj11/pdftables

に与えるように私は指示に従ったが、私は、コードを実行すると

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 
のようなエラーが出ます

# 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機能を実装fileを見れば

は、任意の誰もがこの問題

答えて

2

で私を助けることができますfrom_fileobjのような機能はまだ実装されていません。これはあなたの現在のコードで簡単です:

filepath = 'tests.pdf' 
from pdftables.pdf_document import PDFDocument 
doc = PDFDocument.from_path(filepath) 
関連する問題