-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface.py
More file actions
30 lines (24 loc) · 859 Bytes
/
interface.py
File metadata and controls
30 lines (24 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from os import read
import streamlit as st
import pandas as pd
from tabula import read_pdf
import functions as f
st.set_page_config(page_icon= 'dados/image1.png', page_title= "PDF Extractor", )
f.header_intro()
f.side_bar_credis()
f.header_intro_2()
st.subheader('Upload your PDF by clicking on "Browse Files"')
input_buffer = st.file_uploader("Upload a file", type=("PDF"))
input_loaded = False
if input_buffer:
try:
input_loaded = read_pdf(input_buffer, pages='all')
st.write(f' - {len(input_loaded)} tables were found in your PDF.')
T = True
except Exception as e:
st.text("Error {}".format(e))
if input_loaded:
list_ = list(range(0,len(input_loaded)))
In1 = st.selectbox('Select which table you want to view and download:', list_)
st.dataframe(input_loaded[In1])
f.downfile(input_loaded[In1])