fava.core¶
This module provides the data required by Fava’s reports.
- class fava.core.FavaLedger(path)¶
Create an interface for a Beancount ledger.
- Parameters:
path (
str
) – Path to the main Beancount file.
- account_journal(filtered, account_name, conversion, *, with_children)¶
Journal for an account.
- Parameters:
filtered (
FilteredLedger
) – The currently filtered ledger.account_name (
str
) – An account name.conversion (
str
|Conversion
) – The conversion to use.with_children (
bool
) – Whether to include postings of subaccounts of the account.
- Returns:
Iterable
[tuple
[Directive
,SimpleCounterInventory
,SimpleCounterInventory
]] – A generator of(entry, change, balance)
tuples.
- accounts¶
A
AccountDict
module - details about the accounts.
-
all_entries_by_type:
EntriesByType
¶ Dict of list of all (unfiltered) entries by type.
- attributes¶
An
AttributesModule
instance.
- beancount_file_path¶
The path to the main Beancount file.
- budgets¶
A
BudgetModule
instance.
- changed()¶
Check if the file needs to be reloaded.
- Returns:
bool
– True if a change in one of the included files or a change in a document folder was detected and the file has been reloaded.
- charts¶
A
ChartModule
instance.
- commodities¶
A
CommoditiesModule
instance.
- commodity_pairs()¶
List pairs of commodities.
- context(entry_hash)¶
Context for an entry.
- Parameters:
entry_hash (
str
) – Hash of entry.- Returns:
tuple
[Directive
,dict
[str
,list
[str
]] |None
,dict
[str
,list
[str
]] |None
,str
,str
] – A tuple(entry, before, after, source_slice, sha256sum)
of the (unique) entry with the givenentry_hash
. If the entry is a Balance or Transaction thenbefore
andafter
contain the balances before and after the entry of the affected accounts.
-
errors:
list
[BeancountError
]¶ A list of all errors reported by Beancount.
- extensions¶
A
ExtensionModule
instance.
-
fava_options:
FavaOptions
¶ A dict with all of Fava’s option values.
- file¶
A
FileModule
instance.
- format_decimal¶
A
DecimalFormatModule
instance.
- get_entry(entry_hash)¶
Find an entry.
- Parameters:
entry_hash (
str
) – Hash of the entry.- Returns:
Directive
– The entry with the given hash.- Raises:
FavaAPIError – If there is no entry for the given hash.
- get_filtered(account=None, filter=None, time=None)¶
Filter the ledger.
- Return type:
- static group_entries_by_type()¶
Group entries by type.
- Parameters:
- Returns:
EntriesByType
– A namedtuple containing the grouped lists of entries.
- ingest¶
A
IngestModule
instance.
- interval_balances(filtered, interval, account_name, *, accumulate=False)¶
Balances by interval.
- Parameters:
filtered (
FilteredLedger
) – The currently filtered ledger.interval (
Interval
) – An interval.account_name (
str
) – An account name.accumulate (
bool
) – A boolean,True
if the balances for an interval should include all entries up to the end of the interval.
- Returns:
tuple
[list
[Tree
],list
[DateRange
]] – A pair of a list of Tree instances and the intervals.
-
options:
BeancountOptions
¶ The Beancount options map.
- paths_to_watch()¶
Get paths to included files and document directories.
-
prices:
FavaPriceMap
¶ The price map.
- query_shell¶
A
QueryShell
instance.
- statement_path(entry_hash, metadata_key)¶
Get the path for a statement found in the specified entry.
- Return type:
- watcher¶
- class fava.core.FilteredLedger(ledger, account=None, filter=None, time=None)¶
Filtered Beancount ledger.
- account_is_closed(account_name)¶
Check if the account is closed.
- entries¶
- interval_ranges(interval)¶
Yield date ranges corresponding to interval boundaries.
- ledger¶
fava.core.accounts¶
Account close date and metadata.
- class fava.core.accounts.AccountData(close_date=None, meta=<factory>, uptodate_status=None, balance_string=None, last_entry=None)¶
Holds information about an account.
- class fava.core.accounts.AccountDict(ledger)¶
Account info dictionary.
- EMPTY = AccountData(close_date=None, meta={}, uptodate_status=None, balance_string=None, last_entry=None)¶
- setdefault(key, _=None)¶
Get the account of the given name, insert one if it is missing.
- Return type:
- class fava.core.accounts.LastEntry(date, entry_hash)¶
Date and hash of the last entry for an account.
- fava.core.accounts.balance_string(tree_node)¶
Balance directive for the given account for today.
- Return type:
- fava.core.accounts.uptodate_status(txn_postings)¶
Status of the last balance or transaction.
- Parameters:
txn_postings (
list
[Directive
|TransactionPosting
]) – The TransactionPosting for the account.- Returns:
str
|None
– A status string for the last balance or transaction of the account.’green’: A balance check that passed.
’red’: A balance check that failed.
’yellow’: Not a balance check.
fava.core.attributes¶
Attributes for auto-completion.
fava.core.budgets¶
Parsing and computing budgets.
- class fava.core.budgets.Budget(account: str, date_start: datetime.date, period: Interval, number: Decimal, currency: str)¶
A budget entry.
- fava.core.budgets.BudgetDict¶
A map of account names to lists of budget entries.
- class fava.core.budgets.BudgetError(source: Meta | None, message: str, entry: Directive | None)¶
Error with a budget.
- class fava.core.budgets.BudgetModule(ledger)¶
Parses budget entries.
- calculate(account, begin_date, end_date)¶
Calculate the budget for an account in an interval.
- calculate_children(account, begin_date, end_date)¶
Calculate the budget for an account including its children.
- fava.core.budgets.calculate_budget(budgets, account, date_from, date_to)¶
Calculate budget for an account.
- fava.core.budgets.calculate_budget_children(budgets, account, date_from, date_to)¶
Calculate budget for an account including budgets of its children.
- fava.core.budgets.parse_budgets(custom_entries)¶
Parse budget directives from custom entries.
- Parameters:
custom_entries (
list
[Custom
]) – the Custom entries to parse budgets from.- Returns:
tuple
[Dict
[str
,List
[Budget
]],list
[BudgetError
]] – A dict of accounts to lists of budgets.
Example
2015-04-09 custom “budget” Expenses:Books “monthly” 20.00 EUR
fava.core.charts¶
Provide data suitable for Fava’s charts.
- class fava.core.charts.ChartModule(ledger)¶
Return data for the various charts in Fava.
- static can_plot_query(types)¶
Whether we can plot the given query.
- hierarchy(filtered, account_name, conversion, begin=None, end=None)¶
Render an account tree.
- Return type:
- interval_totals(filtered, interval, accounts, conversion, *, invert=False)¶
Render totals for account (or accounts) in the intervals.
- Parameters:
filtered (
FilteredLedger
) – The filtered ledger.interval (
Interval
) – An interval.accounts (
str
|tuple
[str
,...
]) – A single account (str) or a tuple of accounts.conversion (
str
|Conversion
) – The conversion to use.invert (
bool
) – invert all numbers.
- Return type:
- linechart(filtered, account_name, conversion)¶
Get the balance of an account as a line chart.
- Parameters:
filtered (
FilteredLedger
) – The filtered ledger.account_name (
str
) – A string.conversion (
str
|Conversion
) – The conversion to use.
- Returns:
Iterable
[DateAndBalance
] – A list of dicts for all dates on which the balance of the given account has changed containing the balance (in units) of the account at that date.
- net_worth(filtered, interval, conversion)¶
Compute net worth.
- Parameters:
filtered (
FilteredLedger
) – The filtered ledger.interval (
Interval
) – A string for the interval.conversion (
str
|Conversion
) – The conversion to use.
- Returns:
Iterable
[DateAndBalance
] – A list of dicts for all ends of the given interval containing the net worth (Assets + Liabilities) separately converted to all operating currencies.
- class fava.core.charts.DateAndBalance(date, balance)¶
Balance at a date.
-
balance:
SimpleCounterInventory
¶
-
balance:
- class fava.core.charts.DateAndBalanceWithBudget(date, balance, account_balances, budgets)¶
Balance at a date with a budget.
-
account_balances:
dict
[str
,SimpleCounterInventory
]¶
-
balance:
SimpleCounterInventory
¶
-
account_balances:
fava.core.commodities¶
Attributes for auto-completion.
fava.core.conversion¶
Commodity conversion helpers for Fava.
All functions in this module will be automatically added as template filters.
- fava.core.conversion.AT_COST = <fava.core.conversion._AtCostConversion object>¶
Convert position to its total cost.
- fava.core.conversion.AT_VALUE = <fava.core.conversion._AtValueConversion object>¶
Convert position to its market value.
- class fava.core.conversion.Conversion¶
A conversion.
- abstract apply(inventory, prices, date=None)¶
Apply the conversion to an inventory.
- Return type:
- fava.core.conversion.UNITS = <fava.core.conversion._UnitsConversion object>¶
Convert position to its units.
- fava.core.conversion.conversion_from_str(value)¶
Parse a conversion string.
- Return type:
- fava.core.conversion.convert_position(pos, target_currency, prices, date=None)¶
Get the value of a Position in a particular currency.
- Parameters:
pos (
Position
) – A Position.target_currency (
str
) – The target currency to convert to.prices (
FavaPriceMap
) – A FavaPriceMapdate (
date
|None
) – A datetime.date instance to evaluate the value at, or None.
- Returns:
Amount
– An Amount, with value converted or if the conversion failed just the cost value (or the units if the position has no cost).
- fava.core.conversion.cost_or_value(inventory, conversion, prices, date=None)¶
Get the cost or value of an inventory.
- Return type:
- fava.core.conversion.get_market_value(pos, prices, date=None)¶
Get the market value of a Position.
This differs from the convert.get_value function in Beancount by returning the cost value if no price can be found.
- Parameters:
pos (
Position
) – A Position.prices (
FavaPriceMap
) – A FavaPriceMapdate (
date
|None
) – A datetime.date instance to evaluate the value at, or None.
- Returns:
Amount
– An Amount, with value converted or if the conversion failed just the cost value (or the units if the position has no cost).
- fava.core.conversion.simple_units(inventory)¶
Get the units of an inventory.
- Return type:
- fava.core.conversion.units(inventory)¶
Get the units of an inventory.
- Return type:
fava.core.documents¶
Document path related helpers.
- fava.core.documents.filepath_in_document_folder(documents_folder, account, filename, ledger)¶
File path for a document in the folder for an account.
- Parameters:
documents_folder (
str
) – The documents folder.account (
str
) – The account to choose the subfolder for.filename (
str
) – The filename of the document.ledger (
FavaLedger
) – The FavaLedger.
- Returns:
Path
– The path that the document should be saved at.
- fava.core.documents.is_document_or_import_file(filename, ledger)¶
Check whether the filename is a document or in an import directory.
- Parameters:
filename (
str
) – The filename to check.ledger (
FavaLedger
) – The FavaLedger.
- Returns:
bool
– Whether this is one of the documents or a path in an import dir.
fava.core.extensions¶
Fava extensions.
- class fava.core.extensions.ExtensionDetails(name, report_title, has_js_module)¶
The information about an extension that is needed for the frontend.
- class fava.core.extensions.ExtensionModule(ledger)¶
Fava extensions.
- property extension_details: list[ExtensionDetails]¶
Extension information to provide to the Frontend.
- get_extension(name)¶
Get the extension with the given name.
- Return type:
fava.core.fava_options¶
Fava’s options.
Options for Fava can be specified through Custom entries in the Beancount file. This module contains a list of possible options, the defaults and the code for parsing the options.
- class fava.core.fava_options.FavaOptions(account_journal_include_children=True, auto_reload=False, collapse_pattern=<factory>, currency_column=61, conversion_currencies=(), default_file=None, default_page='income_statement/', fiscal_year_end=FiscalYearEnd(month=12, day=31), import_config=None, import_dirs=(), indent=2, insert_entry=<factory>, invert_income_liabilities_equity=False, language=None, locale=None, show_accounts_with_zero_balance=True, show_accounts_with_zero_transactions=True, show_closed_accounts=False, sidebar_show_queries=5, unrealized='Unrealized', upcoming_events=7, uptodate_indicator_grey_lookback_days=60, use_external_editor=False)¶
Options for Fava that can be set in the Beancount file.
-
fiscal_year_end:
FiscalYearEnd
= FiscalYearEnd(month=12, day=31)¶
-
insert_entry:
list
[InsertEntryOption
]¶
-
fiscal_year_end:
- class fava.core.fava_options.InsertEntryOption(date, re, filename, lineno)¶
Insert option.
An option that determines where entries for matching accounts should be inserted.
- class fava.core.fava_options.OptionError(source: Meta | None, message: str, entry: Directive | None)¶
An error for one the Fava options.
- fava.core.fava_options.parse_option_custom_entry(entry, options)¶
Parse a single custom fava-option entry and set option accordingly.
- Return type:
- fava.core.fava_options.parse_options(custom_entries)¶
Parse custom entries for Fava options.
The format for option entries is the following:
2016-04-01 custom "fava-option" "[name]" "[value]"
- Parameters:
- Returns:
tuple
[FavaOptions
,list
[OptionError
]] – A tuple (options, errors) where options is a dictionary of all options to values, and errors contains possible parsing errors.
fava.core.file¶
Reading/writing Beancount files.
- exception fava.core.file.ExternallyChangedError(path)¶
The file changed externally.
- class fava.core.file.FileModule(ledger)¶
Functions related to reading/writing to Beancount files.
- delete_entry_slice(entry_hash, sha256sum)¶
Delete slice of the source file for an entry.
- Parameters:
- Raises:
FavaAPIError – If the entry is not found or the file changed.
- Return type:
- get_source(path)¶
Get source files.
- Parameters:
path (
Path
) – The path of the file.- Returns:
tuple
[str
,str
] – A string with the file contents and the sha256sum of the file.- Raises:
FavaAPIError – If the file at path is not one of the source files or it contains invalid unicode.
- insert_entries(entries)¶
Insert entries.
- insert_metadata(entry_hash, basekey, value)¶
Insert metadata into a file at lineno.
Also, prevent duplicate keys.
- render_entries(entries)¶
Return entries in Beancount format.
Only renders
Balance
andTransaction
.
- save_entry_slice(entry_hash, source_slice, sha256sum)¶
Save slice of the source file for an entry.
- Parameters:
- Returns:
str
– The sha256sum of the new lines of the entry.- Raises:
FavaAPIError – If the entry is not found or the file changed.
- set_source(path, source, sha256sum)¶
Write to source file.
- Parameters:
- Returns:
str
– The sha256sum of the updated file.- Raises:
FavaAPIError – If the file at path is not one of the source files or if the file was changed externally.
- exception fava.core.file.InvalidUnicodeError(reason)¶
The source file contains invalid unicode.
- exception fava.core.file.NonSourceFileError(path)¶
Trying to read a non-source file.
- fava.core.file.delete_entry_slice(entry, sha256sum)¶
Delete slice of the source file for an entry.
- Parameters:
- Raises:
FavaAPIError – If the file at path is not one of the source files.
- Return type:
- fava.core.file.find_entry_lines(lines, lineno)¶
Lines of entry starting at lineno.
- fava.core.file.find_insert_position(entry, insert_options, default_filename)¶
Find insert position for an entry.
- fava.core.file.get_entry_slice(entry)¶
Get slice of the source file for an entry.
- fava.core.file.insert_entry(entry, default_filename, insert_options, currency_column, indent)¶
Insert an entry.
- Parameters:
- Returns:
tuple
[Path
,list
[InsertEntryOption
]] – A changed path and list of updated insert options.
- fava.core.file.insert_metadata_in_file(path, lineno, indent, key, value)¶
Insert the specified metadata in the file below lineno.
Takes the whitespace in front of the line that lineno into account.
- Return type:
- fava.core.file.save_entry_slice(entry, source_slice, sha256sum)¶
Save slice of the source file for an entry.
- Parameters:
- Returns:
str
– The sha256sum of the new lines of the entry.- Raises:
FavaAPIError – If the file at path is not one of the source files.
fava.core.filters¶
Entry filters.
- class fava.core.filters.AccountFilter(value)¶
Filter by account.
The filter string can either be a regular expression or a parent account.
- class fava.core.filters.AdvancedFilter(value)¶
Filter by tags and links and keys.
- class fava.core.filters.EntryFilter¶
Filters a list of entries.
- exception fava.core.filters.FilterError(filter_type, message)¶
Filter exception.
- class fava.core.filters.FilterSyntaxLexer¶
Lexer for Fava’s filter syntax.
- RULES = (('LINK', '\\^[A-Za-z0-9\\-_/.]+'), ('TAG', '\\#[A-Za-z0-9\\-_/.]+'), ('KEY', '[a-z][a-zA-Z0-9\\-_]+:'), ('ALL', 'all\\('), ('ANY', 'any\\('), ('STRING', '\\w[-\\w]*|"[^"]*"|\\\'[^\\\']*\\\''))¶
- lex(data)¶
A generator yielding all tokens in a given line.
- regex = re.compile('(?P<LINK>\\^[A-Za-z0-9\\-_/.]+)|(?P<TAG>\\#[A-Za-z0-9\\-_/.]+)|(?P<KEY>[a-z][a-zA-Z0-9\\-_]+:)|(?P<ALL>all\\()|(?P<ANY>any\\()|(?P<STRING>\\w[-\\w]*|"[^"]*"|\\\'[^\\\']*\\\')')¶
- tokens = ('ANY', 'ALL', 'KEY', 'LINK', 'STRING', 'TAG')¶
- class fava.core.filters.FilterSyntaxParser¶
-
- precedence = (('left', 'AND'), ('right', 'UMINUS'))¶
- tokens = ('ANY', 'ALL', 'KEY', 'LINK', 'STRING', 'TAG')¶
fava.core.group_entries¶
Entries grouped by type.
- class fava.core.group_entries.EntriesByType(Balance: list[abc.Balance], Close: list[abc.Close], Commodity: list[abc.Commodity], Custom: list[abc.Custom], Document: list[abc.Document], Event: list[abc.Event], Note: list[abc.Note], Open: list[abc.Open], Pad: list[abc.Pad], Price: list[abc.Price], Query: list[abc.Query], Transaction: list[abc.Transaction])¶
Entries grouped by type.
- class fava.core.group_entries.TransactionPosting(transaction: abc.Transaction, posting: abc.Posting)¶
Pair of a transaction and a posting.
- fava.core.group_entries.group_entries_by_account(entries)¶
Group entries by account.
- fava.core.group_entries.group_entries_by_type(entries)¶
Group entries by type.
- Parameters:
- Returns:
EntriesByType
– A namedtuple containing the grouped lists of entries.
fava.core.ingest¶
Ingest helper functions.
- class fava.core.ingest.FileImportInfo(importer_name, account, date, name)¶
Info about one file/importer combination.
- class fava.core.ingest.FileImporters(name, basename, importers)¶
Importers for a file.
-
importers:
list
[FileImportInfo
]¶
-
importers:
- class fava.core.ingest.IngestError(source: Meta | None, message: str, entry: Directive | None)¶
An error with one of the importers.
- class fava.core.ingest.IngestModule(ledger)¶
Exposes ingest functionality.
- extract(filename, importer_name)¶
Extract entries from filename with the specified importer.
- import_data()¶
Identify files and importers that can be imported.
- Returns:
list
[FileImporters
] – A list ofFileImportInfo
.
- fava.core.ingest.file_import_info(filename, importer)¶
Generate info about a file with an importer.
- Return type:
- fava.core.ingest.filepath_in_primary_imports_folder(filename, ledger)¶
File path for a document to upload to the primary import folder.
- Parameters:
filename (
str
) – The filename of the document.ledger (
FavaLedger
) – The FavaLedger.
- Returns:
Path
– The path that the document should be saved at.
fava.core.inventory¶
Alternative implementation of Beancount’s Inventory.
- class fava.core.inventory.CounterInventory¶
A lightweight inventory.
This is intended as a faster alternative to Beancount’s Inventory class. Due to not using a list, for inventories with a lot of different positions, inserting is much faster.
The keys should be tuples
(currency, cost)
.- add_inventory(counter)¶
Add another
CounterInventory
.- Return type:
- reduce(reducer, *args, **_kwargs)¶
Reduce inventory.
Note that this returns a simple
CounterInventory
with just currencies as keys.- Return type:
fava.core.misc¶
Some miscellaneous reports.
- class fava.core.misc.FavaError(source: Meta | None, message: str, entry: Directive | None)¶
Generic Fava-specific error.
- class fava.core.misc.FavaMisc(ledger)¶
Provides access to some miscellaneous reports.
- fava.core.misc.sidebar_links(custom_entries)¶
Parse custom entries for links.
They have the following format:
2016-04-01 custom “fava-sidebar-link” “2014” “/income_statement/?time=2014”
fava.core.module_base¶
Base class for the “modules” of FavaLedger.
fava.core.number¶
Formatting numbers.
- class fava.core.number.DecimalFormatModule(ledger)¶
Formatting numbers.
fava.core.query_shell¶
For using the Beancount shell from Fava.
- class fava.core.query_shell.QueryShell(ledger)¶
A light wrapper around Beancount’s shell.
- execute_query(entries, query)¶
Run a query.
- Parameters:
- Returns:
Any
– A tuple (contents, types, rows) where either the first or the last two entries are None. If the query result is a table, it will be contained intypes
androws
, otherwise the result will be contained incontents
(as a string).
- on_Select(statement)¶
Extract data from a query on the postings.
The general form of a SELECT statement loosely follows SQL syntax, with some mild and idiomatic extensions: :rtype:
None
SELECT [DISTINCT] [<targets>|*] [FROM <from_expr> [OPEN ON <date>] [CLOSE [ON <date>]] [CLEAR]] [WHERE <where_expr>] [GROUP BY <groups>] [ORDER BY <groups> [ASC|DESC]] [LIMIT num]
Where:
- targets: A list of desired output attributes from the postings, and
expressions on them. Some of the attributes of the parent transaction directive are made available in this context as well. Simple functions (that return a single value per row) and aggregation functions (that return a single value per group) are available. For the complete list of supported columns and functions, see help on “targets”. You can also provide a wildcard here, which will select a reasonable default set of columns for rendering a journal.
- from_expr: A logical expression that matches on the attributes of
the directives (not postings). This allows you to select a subset of transactions, so the accounting equation is respected for balance reports. For the complete list of supported columns and functions, see help on “from”.
- where_expr: A logical expression that matches on the attributes of
postings. The available columns are similar to those in the targets clause, without the aggregation functions.
- OPEN clause: replace all the transactions before the given date by
summarizing entries and transfer Income and Expenses balances to Equity.
CLOSE clause: Remove all the transactions after the given date and
CLEAR: Transfer final Income and Expenses balances to Equity.
- query_to_file(entries, query_string, result_format)¶
Get query result as file.
- Parameters:
- Returns:
Any
– A tuple (name, data), where name is either ‘query_result’ or the name of a custom query if the query string is ‘run name_of_query’.data
contains the file contents.- Raises:
FavaAPIError – If the result format is not supported or the
query failed. –
fava.core.tree¶
Account balance trees.
- class fava.core.tree.SerialisedTreeNode(account, balance, balance_children, children, has_txns)¶
A serialised TreeNode.
-
balance:
SimpleCounterInventory
¶
-
balance_children:
SimpleCounterInventory
¶
-
children:
list
[SerialisedTreeNode
]¶
-
balance:
- class fava.core.tree.SerialisedTreeNodeWithCost(account, balance, balance_children, children, has_txns, cost, cost_children)¶
A serialised TreeNode with cost.
-
cost:
SimpleCounterInventory
¶
-
cost_children:
SimpleCounterInventory
¶
-
cost:
- class fava.core.tree.Tree(entries=None, create_accounts=None)¶
Account tree.
- Parameters:
- ancestors(name)¶
Ancestors of an account.
- cap(options, unrealized_account)¶
Transfer Income and Expenses, add conversions and unrealized gains.
- Parameters:
options (
BeancountOptions
) – The Beancount options.unrealized_account (
str
) – The name of the account to post unrealized gains to (as a subaccount of Equity).
- Return type:
- get(name, *, insert=False)¶
Get an account.
- insert(name, balance)¶
Insert account with a balance.
Insert account and update its balance and the balances of its ancestors.
- Parameters:
name (
str
) – An account name.balance (
CounterInventory
) – The balance of the account.
- Return type:
- net_profit(options, account_name)¶
Calculate the net profit.
- Parameters:
options (
BeancountOptions
) – The Beancount options.account_name (
str
) – The name to use for the account containing the net profit.
- Return type:
- class fava.core.tree.TreeNode(name)¶
A node in the account tree.
- balance¶
The account balance.
- balance_children¶
The cumulative account balance.
- has_txns¶
Whether the account has any transactions.
- serialise(conversion, prices, end, *, with_cost=False)¶
Serialise the account.
- Parameters:
conversion (
str
|Conversion
) – The conversion to use.prices (
FavaPriceMap
) – The price map to use.with_cost (
bool
) – Additionally convert to cost.
- Return type:
- serialise_with_context()¶
Serialise, getting all parameters from Flask context.
- Return type:
fava.core.watcher¶
A simple file and folder watcher.
- class fava.core.watcher.Watcher¶
A simple file and folder watcher.
For folders, only checks mtime of the folder and all subdirectories. So a file change won’t be noticed, but only new/deleted files.