File size: 1,003 Bytes
05c6770
 
59f1d32
05c6770
 
 
 
 
 
 
 
59f1d32
 
2cf483d
fdb3261
 
 
 
 
 
 
 
 
 
59f1d32
 
57ce642
59f1d32
004cfa5
 
 
 
59f1d32
 
 
05c6770
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
31
32
33
34
35
36
#from backend import ResultPipeline
import streamlit as st
from backend import InvoicePipeline
def main():
    st.set_page_config(page_title="Bill App")
    st.title("Bill Extractor")

    #This section handle upload of files
    files = st.file_uploader("Upload the file here:", type=["pdf"], accept_multiple_files=True)
    submit = st.button("Extract")

    # If user submitted the files, we need to call our pipeline
    if submit:
        with st.spinner("Please wait, while we processing your information..."):
            pipe = InvoicePipeline(files)
            df_results = pipe.run()
            st.write(df_results)
            convert_to_csv = df_results.to_csv(index = False).encode("utf-8")
            st.download_button(
                "Download",
                convert_to_csv,
                "bill.csv",
                "text/csv",
                key = "download-csv"
            
        )
         

# Calling the main function now
if __name__ == "__main__":
    main()