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:
- skip_path: Path¶
File containing digests of transactions to skip while editing. See
roastery.edit.
- 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_expensereturnsTrue."Income:Unknown"When
roastery.importer.Entry.is_incomereturnsTrue.
- 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
Configwith 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_rootparameter orPROJECT_ROOTenvironment variable is used as a base path for all filesystem related settings.- Parameters:
project_root (Path) – Base path to use for all filesystem paths. If not provided, the
PROJECT_ROOTenvironment variable is used.statements_dir (Path) – See
Config.statements_dirjournal_path (Path) – See
Config.journal_pathmanual_edits_path (Path) – See
Config.manual_edits_pathskip_path (Path) – See
Config.skip_pathflags_path (Path) – See
Config.flags_pathdefault_account_name_suffix (str) – See
Config.default_account_name_suffixdo_not_import_before (date) – See
Config.do_not_import_before
- Returns:
A new
Configinstance.- Raises:
SystemExit – If one of the filesystem paths cannot be inferred from the
project_rootparameter or thePROJECT_ROOTenvironment variable.- Return type: