This command collects transactions in the past 90 days from configured bank accounts, and creates a new transactions file in the data/
folder.
Browser tabs will be open for bank authentication and authorization.
pipenv run fetch_transactions
This command merges all transactions previously saved into a single file to be processed by other commands.
pipenv run merge_transactions
Reports are generated for a given time period selected using two parameters --start-time <ISO8061 DATETIME>
and --end-time <ISO8061 DATETIME>
.
Additionally, a user configuration file[^user_config] path is necessary. For convenience, a default file path is set to be config/user_config.yaml
, however you can override it using --user-configuration-file-path <file_path>
.
Three reports will be saved into /reports
folder:
pipenv run generate_reports --start-time <ISO8061 DATETIME> --end-time <ISO8061 DATETIME> --user-config-file-path
eg:
pipenv run generate_reports --start-time 2023-12-01T00:00+0100 --end-time 2024-02-29T00:00+0100 --user-config-file-path user_configuration_file.yaml
The personal finances application connects to GoCardless Bank Account Data API using their official python client. Two secret values are needed to connect to their API, a secret id and a secret key. These values are read by the personal_finances
application through OS environment variables named respectively, GOCARDLESS_SECRET_ID
and GOCARDLESS_SECRET_KEY
.
The current recommended way of using this application is through the pipenv
command. pipenv
automatically inherits the parent global environment variables, therefore setting GoCardless credentials as env vars on the parent environment is one option.[^env_vars]
An alternative option is to set it in a .env
file, pipenv loads .env into environment variables.
echo GOCARDLESS_SECRET_ID=SecretIdFromGoCardless >.env
echo GOCARDLESS_SECRET_KEY=SecretKeyFromGoCardless >>.env
echo TOKEN_DISK_PATH_PREFIX=/path/to/token/folder >>.env
echo REQUISITION_DISK_PATH_PREFIX=/path/to/token/folder >>.env
pipenv run <command> <arguments>
gh repo clone diegotsutsumi/personal_finances
pipenv install --dev
pipenv run bash -c 'mypy .; mypy --install-types --non-interactive'
pipenv run build
pipenv run tests
pipenv run format
pipenv run aws_lambda_pack
gh pr create --title "brand new feature"
This repository implments tests using pytest, the test files are in the folder personal_finances/tests/
, it has one test file per source file and the file structure follows the source file structure in personal_finances/personal_finances/
.
[^env_vars]: For linux you can either prepend as in NAME=value pipenv ...
or use export NAME=value
, for windows you can use set
.
[^user_config]: A more detailed documentation on the user configuration file can be found here.
In-fin-neat-core code runs on AWS Lambda and a "packing" command (aws_lambda_pack
) is defined for generating a zip file with python dependencies (defined in Pipfile) installed to run on the AWS Lambda runtime.
The aws_lambda_pack
command can be run using pipenv:
pipenv run aws_lambda_pack
This script generates a requirements file using pipenv and install all dependencies in the in_fin_core_package
zip file, created inside the package
folder. This zip can be uploaded to aws lambda function.