Configuration

Variables and settings for Roastery. Many functions in Roastery’s Python API take an instance of the roastery.config.Config.

Environment variables

PROJECT_ROOT

Path to a directory containing the root of your financial statements. Used as the base path for all other Paths in roastery.config.Config.with_defaults().

API

class roastery.config.Config(statements_dir: Path, journal_path: Path, manual_edits_path: Path, skip_path: Path, flags_path: Path, default_account_name_suffix: str = 'Unknown', do_not_import_before: date = None)[source]

Variables and settings for roastery.

Convenience constructor: roastery.config.Config.with_defaults()

Parameters:
  • statements_dir (Path)

  • journal_path (Path)

  • manual_edits_path (Path)

  • skip_path (Path)

  • flags_path (Path)

  • default_account_name_suffix (str)

  • do_not_import_before (date)

statements_dir: Path

Directory of statements

journal_path: Path

Location of the main journal.

manual_edits_path: Path

Filepath to store end user manual edits.

skip_path: Path

File containing digests of transactions to skip while editing. See roastery.edit.

flags_path: Path

File containing digests of transactions that have been flagged for later review.

default_account_name_suffix: str = 'Unknown'

Income/Expenses account name suffix to use when no better one is available in roastery.importer.Entry.as_transaction

"Expenses:Unknown"

When roastery.importer.Entry.is_expense returns True.

"Income:Unknown"

When roastery.importer.Entry.is_income returns True.

do_not_import_before: date = None

Date before which to skip importing transactions.

This is useful if you want to keep a your entire history of financial statements and gradually import / classify them.

classmethod with_defaults(*, project_root: Path = None, statements_dir: Path = None, journal_path: Path = None, manual_edits_path: Path = None, skip_path: Path = None, flags_path: Path = None, default_account_name_suffix: str = 'Unknown', do_not_import_before: date = None) Config[source]

Create a Config with default values.

This is a convenience method that allows users to quickly instantiate Config. You can override the default values by passing in different parameters.

The project_root parameter or PROJECT_ROOT environment variable is used as a base path for all filesystem related settings.

Parameters:
Returns:

A new Config instance.

Raises:

SystemExit – If one of the filesystem paths cannot be inferred from the project_root parameter or the PROJECT_ROOT environment variable.

Return type:

Config