# Path: budgettracker/data.py
# def split_income_expenses(transactions):
#     income = filter(lambda tx: tx.amount > 0.0, transactions)
#     expenses = filter(lambda tx: tx.amount <= 0.0, transactions)
#     return income, expenses
# 
# def extract_transactions_by_label(transactions, labels):
#     def match_label(tx):
#         for exp in labels:
#             if re.match(exp, tx.label):
#                 return True
#         return False
#     matching = filter(match_label, transactions)
#     transactions = filter_out_transactions(transactions, matching)
#     return matching, transactions
# 
# def filter_transactions_period(transactions, start_date=None, end_date=None):
#     if not start_date and not end_date:
#         return transactions
#     return filter(
#         lambda tx: (not start_date or tx.date >= start_date) and (not end_date or tx.date < end_date),
#         transactions)
# 
# def sort_transactions(transactions):
#     return sorted(transactions, key=lambda tx: tx.date, reverse=True)
# 
# def period_to_months(start_date, end_date):
#     dates = [start_date.replace(day=1)]
#     end_date = end_date.replace(day=1) - monthdelta(1)
#     while dates[-1] < end_date:
#         dates.append(dates[-1] + monthdelta(1))
#     return dates


from collections import namedtuple, OrderedDict
from .data import (split_income_expenses, extract_transactions_by_label, filter_transactions_period,
                   sort_transactions, period_to_months)
from monthdelta import monthdelta
import datetime
        return self._sum('real_balance', real=True)
    
    @property
    def balance(self):
        return self._sum('balance')
    
    @property
    def expected_income(self):
        return self._sum('expected_income')
    
    @property
    def income(self):
        return self._sum('income')
    
    @property
    def real_income(self):
        return self._sum('income', real=True)
    
    @property
    def expected_planned_expenses(self):
        return self._sum('expected_planned_expenses')
    
    @property
    def planned_expenses(self):
        return self._sum('planned_expenses')
    
    @property
    def real_planned_expenses(self):
        return self._sum('planned_expenses', real=True)
    

# Path: budgettracker/data.py
# def split_income_expenses(transactions):
#     income = filter(lambda tx: tx.amount > 0.0, transactions)
#     expenses = filter(lambda tx: tx.amount <= 0.0, transactions)
#     return income, expenses
# 
# def extract_transactions_by_label(transactions, labels):
#     def match_label(tx):
#         for exp in labels:
#             if re.match(exp, tx.label):
#                 return True
#         return False
#     matching = filter(match_label, transactions)
#     transactions = filter_out_transactions(transactions, matching)
#     return matching, transactions
# 
# def filter_transactions_period(transactions, start_date=None, end_date=None):
#     if not start_date and not end_date:
#         return transactions
#     return filter(
#         lambda tx: (not start_date or tx.date >= start_date) and (not end_date or tx.date < end_date),
#         transactions)
# 
# def sort_transactions(transactions):
#     return sorted(transactions, key=lambda tx: tx.date, reverse=True)
# 
# def period_to_months(start_date, end_date):
#     dates = [start_date.replace(day=1)]
#     end_date = end_date.replace(day=1) - monthdelta(1)
#     while dates[-1] < end_date:
#         dates.append(dates[-1] + monthdelta(1))
#     return dates


# Path: budgettracker/budget.py
from collections import namedtuple, OrderedDict
from .data import (split_income_expenses, extract_transactions_by_label, filter_transactions_period,
                   sort_transactions, period_to_months)
from monthdelta import monthdelta
import datetime

        return self._sum('real_balance', real=True)
    
    @property
    def balance(self):
        return self._sum('balance')
    
    @property
    def expected_income(self):
        return self._sum('expected_income')
    
    @property
    def income(self):
        return self._sum('income')
    
    @property
    def real_income(self):
        return self._sum('income', real=True)
    
    @property
    def expected_planned_expenses(self):
        return self._sum('expected_planned_expenses')
    
    @property
    def planned_expenses(self):
        return self._sum('planned_expenses')
    
    @property
    def real_planned_expenses(self):
        return self._sum('planned_expenses', real=True)
    

    @property