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_expense
returnsTrue
."Income:Unknown"
When
roastery.importer.Entry.is_income
returnsTrue
.
- 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 orPROJECT_ROOT
environment 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_ROOT
environment variable is used.statements_dir (Path) – See
Config.statements_dir
journal_path (Path) – See
Config.journal_path
manual_edits_path (Path) – See
Config.manual_edits_path
skip_path (Path) – See
Config.skip_path
flags_path (Path) – See
Config.flags_path
default_account_name_suffix (str) – See
Config.default_account_name_suffix
do_not_import_before (date) – See
Config.do_not_import_before
- Returns:
A new
Config
instance.- Raises:
SystemExit – If one of the filesystem paths cannot be inferred from the
project_root
parameter or thePROJECT_ROOT
environment variable.- Return type: