Skip to content

Instantly share code, notes, and snippets.

@howardai
howardai / expenseSum.py
Last active May 26, 2023 06:43
Python program to iterate through filenames and print sum of all currency detected
# As a freelancer, I saved many receipts a day onto a cloud folder with a loose naming system
# consisting of generally dollar amount + dates or some description of the expense.
# As each folder has a slightly different system, here's a program where I could choose which
# naming system I'm using in each folder before it spits out the sum of amount.
import re, os, decimal
#because float() is an approximation and gives weird decimal points
from decimal import Decimal