This PR implements a user configuration feature with a single user supplied YAML file. Currently there are hardcoded global python variables with my personal configurations, so this PR is a step towards making the app more reusable by other people.
Some considerations on the YAML decision:
Given current users have to run command lines to user the app, writing YAML is relatively intuitive for the audience. At some point we'll migrate to API based, which will make this configuration more friendly (hopefully!).
A well formed YAML file can be easily fed into a migration API endpoint in the future.
I considered splitting up into multiple YAML files, but there aren't enough config to make useful sense of multiple YAML files.
Please review the documentation describing the YAML file, hopefully that makes it more clear how to use this app.
Considerations on other choices in this PR:
As I want to decouple "deployment/system configs" from "user configs" I intentionally did not use environment variables to pass this file path. It's rather passed by users with --user-config-file-path in commands requiring it, for convenience I defined a default config path config/user_config.yaml.
I added a schema check for the YAML file using pydantic models, convenient for when the API will become a thing.
Expense Tags begins with hashtag. That's probably a opinionated way of tagging things, but it's simpler for now than to add configurable logic.
Big Note: I implemented only configurations used by the reporting command (aka generate_reports command). We're still missing bank configurations used by the fetching transaction command, the intention is to address additional configs in future PRs.
This PR implements a user configuration feature with a single user supplied YAML file. Currently there are hardcoded global python variables with my personal configurations, so this PR is a step towards making the app more reusable by other people.
Some considerations on the YAML decision:
Considerations on other choices in this PR:
--user-config-file-path
in commands requiring it, for convenience I defined a default config pathconfig/user_config.yaml
.pydantic
models, convenient for when the API will become a thing.Big Note: I implemented only configurations used by the reporting command (aka
generate_reports
command). We're still missing bank configurations used by the fetching transaction command, the intention is to address additional configs in future PRs.