Pymoney is a command-line based personal finance tracker. It allows users to record incomes and expenses, classify them by category, and search or manage them through an intuitive CLI interface.
- π
Add multiple records at once:
category description amount - π View all records and see running balance
- ποΈ Delete records by index
- ποΈ Display nested categories with indentation
- π Find records by category (supports subcategory matching)
- π Persistent storage in
records.txt - β¨ Recursion +
yield/yield fromto traverse nested lists
.
βββ 110062238_ζ½θθ©_hw3.py # Main interactive program
βββ test/
β βββ test_hw3.py # Unit tests with pytest
βββ records.txt # Persistent saved data (created at runtime)
βββ README.md # This file
python3 110062238_ζ½θθΎ_hw3.pypip install pytestpytest1000
meal breakfast -50
food bread -80
salary job 2000
- Line 1: Initial balance
- Remaining: Individual records (category, description, amount)
-
β‘ Object-Oriented Design
Recordclass for dataCategoriesfor recursive category treeRecordsfor list management and file I/O
-
β‘ Generator functions using
yield,yield from -
β‘ Recursive traversal of nested lists
-
β‘ CLI input/output and validation
-
β‘ Data persistence with local files
-
β‘ Unit testing with
pytest
> What do you want to do (add / view / delete / find / exit)? add
Add some expense or income records:
meal breakfast -50, salary job 2000
> view
Index Category Description Amount
1 meal breakfast -50
2 salary job 2000
Now you have 1950 dollars.
> find
Which category? income
Category Description Amount
salary job 2000
The total amount above is 2000.MIT License Β© 2025 owen920831