38 lines
918 B
Python
38 lines
918 B
Python
import sys
|
|
import typing
|
|
|
|
import pandas as pd
|
|
from PyQt6.QtWidgets import QApplication
|
|
|
|
from banking_breakdown.ui.generated_wrapper import GeneratedWindowWrapper
|
|
|
|
|
|
def show_main_window(ui_file, categories: typing.Sequence[str] = None,
|
|
df: pd.DataFrame = None):
|
|
if categories is None:
|
|
categories = []
|
|
|
|
app = QApplication(sys.argv)
|
|
window = GeneratedWindowWrapper(ui_file, categories)
|
|
|
|
if df is not None:
|
|
window.set_statement_data(df)
|
|
|
|
window.show()
|
|
app.exec()
|
|
|
|
|
|
def main():
|
|
from banking_breakdown.statement_parser import get_stripped_statement
|
|
|
|
categories = ["Food", "Rent & Utilities", "Hobbies", "Education",
|
|
"Transportation", "Social Life", "Other"]
|
|
|
|
df = get_stripped_statement("../../res/banking_statement_2023.csv")
|
|
|
|
show_main_window("../../res/main_window.ui", categories, df)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|