Frontend Part
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
# from backend import ResultPipeline
|
2 |
import streamlit as st
|
|
|
3 |
def main():
|
4 |
# Just for setting up the title & head bar
|
5 |
st.set_page_config(page_title = "Bill App")
|
@@ -10,7 +11,21 @@ def main():
|
|
10 |
submit = st.button("Extract")
|
11 |
|
12 |
# If a user has submitted the fieles, we need to call our pipeline
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
|
16 |
# Calling the main function
|
|
|
1 |
# from backend import ResultPipeline
|
2 |
import streamlit as st
|
3 |
+
from backend import InvoicePipeline
|
4 |
def main():
|
5 |
# Just for setting up the title & head bar
|
6 |
st.set_page_config(page_title = "Bill App")
|
|
|
11 |
submit = st.button("Extract")
|
12 |
|
13 |
# If a user has submitted the fieles, we need to call our pipeline
|
14 |
+
if submit:
|
15 |
+
with st.spinner("Please wait, while we are processing your information...")
|
16 |
+
pipe = InvoicePipeline(files)
|
17 |
+
df_results = pipe.run()
|
18 |
+
st.write(df_results)
|
19 |
+
|
20 |
+
|
21 |
+
convert_to_csv = df_results.to_csv(index = False).encode("utf-8")
|
22 |
+
st.download_button(
|
23 |
+
"Download",
|
24 |
+
convert_to_csv,
|
25 |
+
"bills.csv",
|
26 |
+
"text/csv",
|
27 |
+
key = "download-csv"
|
28 |
+
)
|
29 |
|
30 |
|
31 |
# Calling the main function
|