invoice2data
invoice2data copied to clipboard
Input readers error
When using a input readers except googlevision there gives an error
AttributeError Traceback (most recent call last)
<ipython-input-42-846894c98fd2> in <module>
5 templates = read_templates('templates')
6 print(templates)
----> 7 result = extract_data(filename, templates=templates,input_module = 'pdfminer')
8 print(result)
c:\programdata\miniconda3\lib\site-packages\invoice2data\main.py in extract_data(invoicefile, templates, input_module)
80
81 # print(templates[0])
---> 82 extracted_str = input_module.to_text(invoicefile).decode('utf-8')
83
84 logger.debug('START pdftotext result ===========================')
AttributeError: 'str' object has no attribute 'to_text'
i dont try google vision yet but all of them gives this error
Your input_module parameter shouldn't be a string, it should just be input_module = pdfminer
as the function calls for the to_text()
function of the input_module classes
@jintaogao was correct, thanks @jintaogao for your help here