Skip to content

About

I want to automate the data entry of my receipts. So I can analyze my spending habits

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ReceiptTracker

I want to automate the data entry of my receipts. So I can analyze my spending habits

Journal entries of my progression -- thoughts and plans

July 7th:

Made this repo. Started with exploring how to connect python to a google sheet.

  • Worksheets and spreadsheets are 2 different things. Spreadsheet is the FILE. worksheet is the sheet in the file.
  • I want to implement bank statements in a separate Spreadsheet, with each worksheet for each month (some tidying needs to be done)
  • And for receipt tracker, to be in a separate spreadsheet, separated by months for each worksheet.
  • For now, TestConnection.py is a testing ground for my next steps: OCR and pdf parser

July 11th:

  • Continued the experimenting, i didnt know the google api has rate limits so we dont do update_a_cell anymore. append_row is my new best friend
  • Things to consider: I have Chequing, Savings, and Credit statements to import. I will need to merge them as one before i fuse with receipts table
  • Started on TestParser.py, Monty Python and the holy grail reference spotted in the parse library example LMAO
  • Decided not to go with parse, stick with regex bcs theres no clear delimitter

WIP 1.0:

  • 1.1 Year for the date object in list -- lookout for december, take the year from the pdf title?
  • 1.11 can do location analysis too in the desc
  • 1.2 input type (credit, chequing, savings) assigned on when importing the list to the corresponding worksheet

July 18th:

  • I got exhausted from my food service job but now I've got time and tidied my receipts. I realize the receipts have different date formats and that would be hell to upload Unless I do machine learning on the image to extract it.
  • Anyways I want this functional soon bcs I have so much receipt backlog all the way from September... I do not want to be manually matching these receipts.
  • Today I plan to have the bank statement JSON uploadable to the google sheets.
  • Fixed up TestParser.py & TestConnection.py to be modular with minimized inputs
  • Realized the Regex i made only caters to my credit bank statements. I need to make a separate regex to read my chequing statements...
  • Working on the chequing bank statement parser. It seems I have come into the problem of the parser reading differently of the tables per page. I have no choice but to read it as table as the spaces between columns is monumental to differentiating if it is an inflow or outflow.

WIP 2.0:

  • 2.1 Receipt parser -- have a cash/debit/credit for the reconciliation process to skip cash
  • 2.11 If no receipt - bank statement entry still goes thru
  • 2.12 if no bank statement entry -- what happens to receipt? consider as cash?

July 21st:

  • Since these bank statements are only parsing my bank statements (and given they do not change their formatting).
  • I've decided I am going to crop the PDF since the chequing statement has been problematic (defining the border 1 column short, inconsisten column definition across pages).
  • The first row in each page is hell... Why are the newlines fused. The first row is being ignored if i crop it right bcs there is no visible line defining the ceiling...
  • I can't use "text" horizontal strategy bcs one entry can occupy two "rows" (it uses newline fsr)
  • thanks to RickVincent's discussion on the pdfplumber discussion page. I've got it :) NVM that answer was from 2025. things changed since then probably..?
  • Ending today on refining the extraction on chequing still. first row extraction is tricky...

Data flow:

all bank statements -> into one sheet -> parse into separate months biweekly (2x a month)

July 24th:

  • today is a short one, since I have a dragonboat race to get to with Shockwave soon
  • first row on first page is included! never thought that I can both use the strategy and explicit. Thanks Claude
  • second page onwards, same strategy does work, but the parser outputs the list a bit odd. as it's nested?

July 28th midnight hours:

TODO: IF ITS DIFFERENT YEARS... edge case December-January ToT

  • thankfully the savings format is the same as chequing. I can reuse the same format as chequing I just had to expand the columns since the values are larger...
  • idk if i want the balance update per entry in the statement though... hmmmm
  • I need to reconcile between the 3 banks stuffs now

August 7th

  • I've been working on this awhile, havent uploaded bcs there was some sensitive information
  • but now I've obscured it with a .env!

WIP 3.0:

  • 3.1 find a suitable date to do the reconciliation once a month
  • 3.2 label spendings with categories yummmmmm

August 10th - 15th

  • tbh i'm indecisive whether to make the codes verryyy modular or stop modularizing at one point.
  • they're not called more than once either. so nah
  • maybe I don't need to record the opening balance for my bank? but ahhh I'll just keep it in to make fetching for info later easier

WIP 4.0:

  • 4.1 tidy up the APIError exception -- made but not completely tested
  • 4.2 check if the statement has alr been uploaded -- skip entries that are alr loaded, continue loading the rest
  • 4.3 date sorter for bank reconciling
  • 4.31 DATE NEEDS TO BE STANDARDIZES RN ITS JUST TEXT (and single digit days are intertwined betw 01 or 1... sigh) the answer is .append_rows(value_input_option="USER_ENTERED") <3
  • itd be nice if automatic expenditures (data bill, MSP bill) is auto entried in. this will be on the receipts side (all matters user input)

August 16th

August 19th

  • Date sorted by standardizing all the dates in the sheets (it has to be like 'Jun 02 2026'. yes. the single digit must start with 0) and use sort lambda

About

I want to automate the data entry of my receipts. So I can analyze my spending habits

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages