|
|
|
import streamlit as st |
|
from backend import InvoicePipeline |
|
def main(): |
|
|
|
st.set_page_config(page_title = "Bill App") |
|
st.title("Bill Extractor") |
|
|
|
|
|
files = st.file_uploader("Upload the files here..", type = ["pdf"], accept_multiple_files = True) |
|
submit = st.button("Extract") |
|
|
|
|
|
if submit: |
|
with st.spinner("Please wait, while we are 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, |
|
"bills.csv", |
|
"text/csv", |
|
key = "download-csv" |
|
) |
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
main() |