diff --git a/financial_reports/transactions.py b/financial_reports/transactions.py index 39b3c8748..d5ca5726c 100644 --- a/financial_reports/transactions.py +++ b/financial_reports/transactions.py @@ -1,12 +1,18 @@ import os + import pandas as pd + def get_transactions_in_date_range(start_date, end_date): # Load the transactions CSV file from the transactions directory - transactions_file = os.path.join(os.path.dirname(__file__), '..', 'transactions', 'transactions.csv') + transactions_file = os.path.join( + os.path.dirname(__file__), "..", "transactions", "transactions.csv" + ) transactions_df = pd.read_csv(transactions_file) # Filter transactions by date range - transactions_df = transactions_df[(transactions_df['date'] >= start_date) & (transactions_df['date'] <= end_date)] + transactions_df = transactions_df[ + (transactions_df["date"] >= start_date) & (transactions_df["date"] <= end_date) + ] return transactions_df