Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress or remove python tabula-py warnings

Tags:

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.

like image 627
Gammer Avatar asked Nov 15 '17 10:11

Gammer


People also ask

What is Python Tabula?

What is Tabula? Tabular is a basic wrapper of tabula-java that allows users to the extraction of the table and converts the PDF file directly into Data frames or JSON using Python Programming language. The user can also extract tables from PDF and convert them into TSV, CSV, or JSON format files.

Is Java required for Tabula?

Installation. Before installing tabula-py, ensure you have Java runtime on your environment. You can install tabula-py form PyPI with pip command.

What is tabula stream?

The naming for parsing methods inside Camelot (i.e. Lattice and Stream) was inspired from Tabula. Lattice is used to parse tables that have demarcated lines between cells, while Stream is used to parse tables that have whitespaces between cells to simulate a table structure.


1 Answers

tabula-py author is here. Setting silent=True suppresses the tabula-java logs. see also: https://github.com/chezou/tabula-py/blob/e11d6f0ac518810b6d92b60a815e34f32f6bf085/tabula/io.py#L65 https://tabula-py.readthedocs.io/en/latest/tabula.html#tabula.io.build_options

like image 71
chezou Avatar answered Feb 20 '23 01:02

chezou