Spaces:
Sleeping
Sleeping
import gradio as gr | |
import pandas as pd | |
from extract import extract_upi_transactions | |
from clean import clean_upi_data | |
from analysis import analyze_spending_pattern, get_financial_advice | |
from visualize import plot_spending_by_category | |
def process_pdf(file): | |
df = extract_upi_transactions(file.name) | |
df = clean_upi_data(df) | |
analysis = analyze_spending_pattern(df) | |
advice = get_financial_advice(df) | |
plot_spending_by_category(df) | |
return df, analysis, advice | |
interface = gr.Interface( | |
fn=process_pdf, | |
inputs=gr.File(), | |
outputs=[gr.Dataframe(), "text", "text"], | |
title="UPI Financial Analyzer", | |
description="Upload your UPI transaction statement to get insights and recommendations." | |
) | |
if __name__ == "__main__": | |
interface.launch() |