Spaces:
Runtime error
Runtime error
tjxj
commited on
Commit
·
0b93b46
1
Parent(s):
33d6f0c
Add application file
Browse files
app.py
CHANGED
|
@@ -5,18 +5,12 @@ import streamlit as st
|
|
| 5 |
import base64
|
| 6 |
import subprocess # process in the os
|
| 7 |
from subprocess import STDOUT #os process manipuation
|
| 8 |
-
import os
|
| 9 |
import camelot as cam # extracting tables from PDFs
|
| 10 |
|
| 11 |
# to run this only once and it's cached
|
| 12 |
-
@st.cache
|
| 13 |
-
def gh():
|
| 14 |
-
"""install ghostscript on the linux machine"""
|
| 15 |
-
proc = subprocess.Popen('apt-get install -y ghostscript', shell=True, stdin=None, stdout=open(os.devnull,"wb"), stderr=STDOUT, executable="/bin/bash")
|
| 16 |
-
proc.wait()
|
| 17 |
-
|
| 18 |
-
gh()
|
| 19 |
|
|
|
|
| 20 |
st.title("PDF Table Extractor")
|
| 21 |
|
| 22 |
input_pdf = st.file_uploader(label = "", type = 'pdf')
|
|
|
|
| 5 |
import base64
|
| 6 |
import subprocess # process in the os
|
| 7 |
from subprocess import STDOUT #os process manipuation
|
| 8 |
+
import os,sys
|
| 9 |
import camelot as cam # extracting tables from PDFs
|
| 10 |
|
| 11 |
# to run this only once and it's cached
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
+
sys('apt-get install -y ghostscript')
|
| 14 |
st.title("PDF Table Extractor")
|
| 15 |
|
| 16 |
input_pdf = st.file_uploader(label = "", type = 'pdf')
|