How to use the fava.api.budgets.Budgets function in fava

To help you get started, we’ve selected a few fava examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github beancount / fava / tests / test_budgets.py View on Github external
def _get_budgets(beancount_string):
    entries, _, _ = parser.parse_string(beancount_string, dedent=True)
    return Budgets(entries)
github beancount / fava / tests / test_budgets.py View on Github external
def test_budgets(load_doc):
    """
    2016-01-01 custom "budget" Expenses:Groceries "weekly" 100.00 CNY
    2016-06-01 custom "budget" Expenses:Groceries "weekly"  10.00 EUR"""
    entries, _, _ = load_doc
    budget = Budgets(entries)
    budgets = budget.budget('Expenses:Groceries', date(2016, 6, 1), date(2016, 6, 8)) # noqa
    assert budgets['CNY'] == Decimal(100)
    assert budgets['EUR'] == Decimal(10)