Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

# read table data from PDF into dataframe and save it as csv or json

# read table data from PDF into dataframe and save it as csv or json
#tabula-py requires a java environment, so let's check the java environment on your machine.
!java -version

!pip install -q tabula-py

import tabula

tabula.environment_info()

import tabula
pdf_path = "https://github.com/chezou/tabula-py/raw/master/tests/resources/data.pdf"

dfs = tabula.read_pdf(pdf_path, stream=True)
# read_pdf returns list of DataFrames
print(len(dfs))
dfs[0]

# You can convert from pdf into JSON, CSV, TSV

tabula.convert_into(pdf_path, "test.json", output_format="json")
!cat test.json
Comment

PREVIOUS NEXT
Code Example
Python :: Using Python-docx to update cell content of a table 
Python :: python print exection type 
Python :: how to create one list from 2d list python 
Python :: Missing data counts and percentage 
Python :: python basic programs kilometers to miles 
Python :: install nsml python 
Python :: python kiwi install 
Python :: combine column in csv python pandas 
Python :: phone numbers python 
Python :: python bubble plot 
Python :: how to fit the whole text beside checkbox in ipywidgets 
Python :: python write list to file with newlines 
Python :: add colorbar without changing subplot size 
Python :: email confirmation django 
Python :: Python try with else clause 
Python :: menu with icons tkinter 
Python :: gitlab-ci.yml for python project 
Python :: pandas redondear un valor 
Python :: numba for python 
Python :: concat Pandas Dataframe with Numpy array. 
Python :: call python from bash shell 
Python :: python float to int 
Python :: fast fourier transform 
Python :: python selenium element not interactable while headless 
Python :: python Cerberus 
Python :: python code to increase cpu utilization 
Python :: print(f ) python 
Python :: displaying data from this column where value is this python 
Python :: unique list 
Python :: delete list using slicing 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =