Grocery spreadsheet splitter vibe coded with claude 3.7, sorry.
Python, be able to run python in command line. No other requirements.
- clone this repo and open the folder in vs code
- spreadsheet must be organized like this:
| Name | actual name | Price | Name1 | Name2 | Name3 | as many names as you want |
|---|---|---|---|---|---|---|
| TP | toilet paper | X | X | X | ||
| BRads | sausage | X | ||||
| PURR LIT | litter | X | X | X |
- select columns and rows of spreadsheet including their title
- paste into new document in visual studio
- save the file as 2025-02-15_aldi.tsv or whatever you want. must be .tsv file
- in visual studio file explorer, right click the new file, copy path name
- in terminal type
python3 calc.pyorpython calc.pyif that doesn't work. - paste in the path you copied when prompted
- follow the instructions as prompted
A command-line utility for parsing TSV (tab-separated values) files containing grocery expenses and calculating how much each person owes based on shared expenses.
- Path to a TSV file containing grocery data
- User-specified column mappings:
- Column containing item names
- Column containing prices
- Columns representing people splitting expenses
- Marker indicating participation in expense splitting (default: "X")
- Parse the TSV file using the specified column mappings
- For each row:
- Extract the item name and price
- Determine which people are splitting this expense
- Calculate each person's share (price ÷ number of people)
- Add this amount to each person's running total
- Increment item count for each participating person
- Calculate the grand total of all expenses
- Total cost of all grocery items
- Itemized list for each person including:
- Amount they owe
- Count of items they're splitting
- Proper pluralization of "item/items" based on count
- List is sorted alphabetically by person name
- File not found errors
- Invalid price format warnings
- Rows with insufficient data warnings
- Items with no assigned participants warnings
- Python 3.x
- No external dependencies beyond the standard library