Suppress or remove python tabula-py warnings

Viewed 3207

I have python code using tabula-py for reading PDF to extract the text and then change it to tabular form via tabula-py. But it gives me a warning.

Nov 15, 2017 3:40:23 PM org.apache.pdfbox.pdmodel.font.PDSimpleFont toUnicode
WARNING: No Unicode mapping for .notdef (9) in font Helvetica

This warning is of tabula-py, And Tabula-py is written in Java. So I cannot simply use -W ignore to suppress the above warning.

Is there any way to remove or suppress the above warning.

3 Answers

Tabula provides a built in feature to suppress java warning.

Try silent=True parameter in request:

tabula.read_pdf("/path/to/sample.pdf", pages="all", silent=True)

Documentation Source

try this may help:

import warnings
warnings.filterwarnings('ignore')
Related