This experimental project aims to answer simple financial questions from the household budget.
- Munge the Google Budget spreadsheets to a single CSV
- Use Sketch to generate Python code to run analysis and plots
Run the development server:
uvicorn src.bean_counter.main:app --port 7998 --reload
To ingest all costs from the Family Google Sheets, run with httpie
:
http POST http://127.0.0.1:7998/run
-
Enable the Google Drive API and Google Sheets API for the Google Project
-
Add a service account to the Google Project
-
https://console.cloud.google.com/iam-admin/serviceaccounts/create?project=bean-counter-387506
- Create a new key to the service account
- Download the JSON file and save it to
./config/service_account.json
-
Google Project Dashboard
-
Google APIs
-
Fam Budget
-
Use Google Apps Script to make HTTP requests to trigger munge
-
Using FastAPI with AWS SAM the Easy Way!
-
Deploy FastAPI on AWS Lambda
If you have the credentials, run mine:
After installation/credentials set up AWS CLI v2:
-
aws lambda list-functions
Already created the Lambda and need to update it?
bash make update-lambda
-
Get Python 3.10 packages (see ./aws/3.10-requirements.txt)
-
Create zip file
lambda_function.zip
:pip install -t lib -r 3.10-requirements.txt (cd lib; zip ../lambda_function.zip -r .) (cd src/bean_counter; zip ../../lambda_function.zip -u main.py; zip ../../lambda_function.zip -u .env; cd -) zip lambda_function.zip -r config
-
Upload it to S3 with:
aws s3 cp lambda_function.zip s3://projects-bean-counter/lambda_function.zip
-
Create the Lambda function:
-
Upload by giving it S3 address
aws lambda update-function-code --function-name bean-counter --s3-bucket projects-bean-counter --s3-key lambda_function.zip
-
Tweak Configuration (Memory, Timeout)
-
Deactivate/Reactivate (Optional)
Deactivate:
aws lambda put-function-concurrency --function-name bean-counter --reserved-concurrent-executions 0
Reactivate:
aws lambda put-function-concurrency --function-name bean-counter --reserved-concurrent-executions 10
Generated from https://jakebathman.github.io/Markdown-Table-Generator/
Direction | Name | Category | Date | GBP |
---|---|---|---|---|
Outgoing | Petrol | 05/23 | 400 | |
Incoming | Salary | 03/23 | 3,500 | |
Incoming | Carry over from Joint | 12/22 | 400 |