budget-analytics 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- budget_analytics-0.1.0/.gitignore +20 -0
- budget_analytics-0.1.0/PKG-INFO +63 -0
- budget_analytics-0.1.0/README.md +51 -0
- budget_analytics-0.1.0/pyproject.toml +27 -0
- budget_analytics-0.1.0/src/budget_analytics/__init__.py +19 -0
- budget_analytics-0.1.0/src/budget_analytics/analytics.py +84 -0
- budget_analytics-0.1.0/tests/test_analytics.py +141 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
venv/
|
|
3
|
+
__pycache__/
|
|
4
|
+
.pytest_cache/
|
|
5
|
+
|
|
6
|
+
# App data and logs (local only)
|
|
7
|
+
*.db
|
|
8
|
+
server.log
|
|
9
|
+
|
|
10
|
+
# Front-end (also covered by frontend/.gitignore)
|
|
11
|
+
node_modules/
|
|
12
|
+
dist/
|
|
13
|
+
|
|
14
|
+
# Terraform: state can contain secrets
|
|
15
|
+
.terraform/
|
|
16
|
+
*.tfstate
|
|
17
|
+
*.tfstate.*
|
|
18
|
+
|
|
19
|
+
# Course materials (lecturer slides, CA brief): private, never on GitHub
|
|
20
|
+
course-materials/
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: budget-analytics
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Pure budget maths in whole cents: monthly totals, spending per category, budget status and recurring payments
|
|
5
|
+
Project-URL: Source, https://github.com/NoMaRu123/budget-tracker
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Classifier: Operating System :: OS Independent
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# budget-analytics
|
|
14
|
+
|
|
15
|
+
Pure budget maths for Python. It has no database and no web framework, and no dependencies outside the standard library.
|
|
16
|
+
|
|
17
|
+
Every amount is in whole cents (`6435` means 64.35), so there are no float rounding errors. A transaction is a plain dict:
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
{"date": "2026-11-14", "description": "Tesco", "amount_cents": 6435, "type": "expense", "category_id": 1}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
pip install budget-analytics
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Functions
|
|
30
|
+
|
|
31
|
+
| Function | What it gives back |
|
|
32
|
+
|---|---|
|
|
33
|
+
| `monthly_totals(transactions)` | `{"income_cents", "expenses_cents", "balance_cents"}` |
|
|
34
|
+
| `spending_by_category(transactions)` | `{category_id: cents spent}`; income isn't counted |
|
|
35
|
+
| `budget_status(limit_cents, spent_cents)` | `limit_cents`, `spent_cents`, `left_cents` (negative when over), `percent_used`, and `status`: `ok` under 80%, `warning` from 80% to 100%, `over` above 100% |
|
|
36
|
+
| `find_recurring(transactions, min_months=3, tolerance_percent=10)` | payments with the same description in at least 3 different months, each within 10% of the typical amount; biggest first |
|
|
37
|
+
| `normalise_description(text)` | `"NETFLIX.COM 8472"` → `"netflix com"`, used to match bank descriptions |
|
|
38
|
+
|
|
39
|
+
## Example
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from budget_analytics import budget_status, spending_by_category
|
|
43
|
+
|
|
44
|
+
transactions = [
|
|
45
|
+
{"date": "2026-11-10", "description": "Dinner", "amount_cents": 12860, "type": "expense", "category_id": 2},
|
|
46
|
+
{"date": "2026-11-20", "description": "Pizza night", "amount_cents": 4280, "type": "expense", "category_id": 2},
|
|
47
|
+
]
|
|
48
|
+
spent = spending_by_category(transactions) # {2: 17140}
|
|
49
|
+
budget_status(15000, spent[2])
|
|
50
|
+
# {'limit_cents': 15000, 'spent_cents': 17140, 'left_cents': -2140, 'percent_used': 114, 'status': 'over'}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Run the tests
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
cd library
|
|
57
|
+
pip install pytest
|
|
58
|
+
pytest
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Licence
|
|
62
|
+
|
|
63
|
+
MIT
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# budget-analytics
|
|
2
|
+
|
|
3
|
+
Pure budget maths for Python. It has no database and no web framework, and no dependencies outside the standard library.
|
|
4
|
+
|
|
5
|
+
Every amount is in whole cents (`6435` means 64.35), so there are no float rounding errors. A transaction is a plain dict:
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
{"date": "2026-11-14", "description": "Tesco", "amount_cents": 6435, "type": "expense", "category_id": 1}
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
pip install budget-analytics
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Functions
|
|
18
|
+
|
|
19
|
+
| Function | What it gives back |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `monthly_totals(transactions)` | `{"income_cents", "expenses_cents", "balance_cents"}` |
|
|
22
|
+
| `spending_by_category(transactions)` | `{category_id: cents spent}`; income isn't counted |
|
|
23
|
+
| `budget_status(limit_cents, spent_cents)` | `limit_cents`, `spent_cents`, `left_cents` (negative when over), `percent_used`, and `status`: `ok` under 80%, `warning` from 80% to 100%, `over` above 100% |
|
|
24
|
+
| `find_recurring(transactions, min_months=3, tolerance_percent=10)` | payments with the same description in at least 3 different months, each within 10% of the typical amount; biggest first |
|
|
25
|
+
| `normalise_description(text)` | `"NETFLIX.COM 8472"` → `"netflix com"`, used to match bank descriptions |
|
|
26
|
+
|
|
27
|
+
## Example
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
from budget_analytics import budget_status, spending_by_category
|
|
31
|
+
|
|
32
|
+
transactions = [
|
|
33
|
+
{"date": "2026-11-10", "description": "Dinner", "amount_cents": 12860, "type": "expense", "category_id": 2},
|
|
34
|
+
{"date": "2026-11-20", "description": "Pizza night", "amount_cents": 4280, "type": "expense", "category_id": 2},
|
|
35
|
+
]
|
|
36
|
+
spent = spending_by_category(transactions) # {2: 17140}
|
|
37
|
+
budget_status(15000, spent[2])
|
|
38
|
+
# {'limit_cents': 15000, 'spent_cents': 17140, 'left_cents': -2140, 'percent_used': 114, 'status': 'over'}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Run the tests
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
cd library
|
|
45
|
+
pip install pytest
|
|
46
|
+
pytest
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Licence
|
|
50
|
+
|
|
51
|
+
MIT
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# How to build the package: the tool that turns src/ into a file pip can install
|
|
2
|
+
[build-system]
|
|
3
|
+
requires = ["hatchling"]
|
|
4
|
+
build-backend = "hatchling.build"
|
|
5
|
+
|
|
6
|
+
# What PyPI shows, and what pip needs to know
|
|
7
|
+
[project]
|
|
8
|
+
name = "budget-analytics" # the name for "pip install budget-analytics"
|
|
9
|
+
version = "0.1.0" # bump this for every new upload: PyPI never accepts the same version twice
|
|
10
|
+
description = "Pure budget maths in whole cents: monthly totals, spending per category, budget status and recurring payments"
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
license = "MIT"
|
|
14
|
+
dependencies = [] # standard library only: nothing extra gets installed
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"Topic :: Office/Business :: Financial",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
Source = "https://github.com/NoMaRu123/budget-tracker"
|
|
23
|
+
|
|
24
|
+
# pytest finds the package in src/ without installing it first
|
|
25
|
+
[tool.pytest.ini_options]
|
|
26
|
+
pythonpath = ["src"]
|
|
27
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""budget-analytics: pure functions for budget maths (totals, spending per category, budget status, recurring payments)."""
|
|
2
|
+
from budget_analytics.analytics import (
|
|
3
|
+
WARNING_PERCENT,
|
|
4
|
+
budget_status,
|
|
5
|
+
find_recurring,
|
|
6
|
+
monthly_totals,
|
|
7
|
+
normalise_description,
|
|
8
|
+
spending_by_category,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
__version__ = "0.1.0"
|
|
12
|
+
__all__ = [ # what "from budget_analytics import *" gives you: the public functions
|
|
13
|
+
"WARNING_PERCENT",
|
|
14
|
+
"budget_status",
|
|
15
|
+
"find_recurring",
|
|
16
|
+
"monthly_totals",
|
|
17
|
+
"normalise_description",
|
|
18
|
+
"spending_by_category",
|
|
19
|
+
]
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""Pure budget maths: no database and no web framework, so any Python app can use it.
|
|
2
|
+
|
|
3
|
+
Every amount is in whole cents (6435 means 64.35), so there are no float rounding errors.
|
|
4
|
+
A transaction is a plain dict with the keys "date", "description", "amount_cents", "type" and "category_id".
|
|
5
|
+
"""
|
|
6
|
+
import re
|
|
7
|
+
from collections import defaultdict
|
|
8
|
+
from statistics import median
|
|
9
|
+
|
|
10
|
+
WARNING_PERCENT = 80 # from 80% used, a budget is in "warning"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def monthly_totals(transactions: list[dict]) -> dict:
|
|
14
|
+
"""Income, expenses and what's left over, for whatever transactions you pass in (usually one month)."""
|
|
15
|
+
income = sum(t["amount_cents"] for t in transactions if t["type"] == "income") # add up only the income
|
|
16
|
+
expenses = sum(t["amount_cents"] for t in transactions if t["type"] == "expense") # add up only the spending
|
|
17
|
+
return {"income_cents": income, "expenses_cents": expenses, "balance_cents": income - expenses}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def spending_by_category(transactions: list[dict]) -> dict[int, int]:
|
|
21
|
+
"""Total spending per category id, e.g. {1: 17140, 3: 2500}. Income is not spending, so it's left out."""
|
|
22
|
+
spent = defaultdict(int) # a dict that starts every new key at 0, so += works the first time
|
|
23
|
+
for t in transactions:
|
|
24
|
+
if t["type"] == "expense":
|
|
25
|
+
spent[t["category_id"]] += t["amount_cents"]
|
|
26
|
+
return dict(spent) # hand back a normal dict
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def budget_status(limit_cents: int, spent_cents: int, warning_percent: int = WARNING_PERCENT) -> dict:
|
|
30
|
+
"""How much of one budget is used: ok under 80%, warning from 80% to 100%, over above 100%."""
|
|
31
|
+
if limit_cents <= 0: # a budget of 0 would mean dividing by 0 below
|
|
32
|
+
raise ValueError("limit_cents must be more than 0")
|
|
33
|
+
if spent_cents > limit_cents: # exactly at the limit is not over
|
|
34
|
+
status = "over"
|
|
35
|
+
elif spent_cents * 100 >= limit_cents * warning_percent: # whole numbers only: no float rounding at the 80% line
|
|
36
|
+
status = "warning"
|
|
37
|
+
else:
|
|
38
|
+
status = "ok"
|
|
39
|
+
return {
|
|
40
|
+
"limit_cents": limit_cents,
|
|
41
|
+
"spent_cents": spent_cents,
|
|
42
|
+
"left_cents": limit_cents - spent_cents, # negative when over: -2140 means 21.40 over
|
|
43
|
+
"percent_used": round(spent_cents * 100 / limit_cents), # for the bar and the label, e.g. 86
|
|
44
|
+
"status": status,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def normalise_description(text: str) -> str:
|
|
49
|
+
"""'NETFLIX.COM 8472' and 'Netflix.com 9921' are the same payment: keep only the lower-case letters."""
|
|
50
|
+
words = re.sub(r"[^a-z]+", " ", text.lower()) # anything that isn't a letter becomes a space
|
|
51
|
+
return " ".join(words.split()) # squash runs of spaces: "netflix com"
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def find_recurring(transactions: list[dict], min_months: int = 3, tolerance_percent: int = 10) -> list[dict]:
|
|
55
|
+
"""Spot repeating payments, like rent or a subscription.
|
|
56
|
+
|
|
57
|
+
A payment counts as recurring when the same description (see normalise_description) is spent in at least
|
|
58
|
+
`min_months` different months, and every amount is within `tolerance_percent` of the typical amount.
|
|
59
|
+
"""
|
|
60
|
+
groups = defaultdict(list) # "netflix com" -> every Netflix expense
|
|
61
|
+
for t in transactions:
|
|
62
|
+
if t["type"] == "expense":
|
|
63
|
+
key = normalise_description(t["description"])
|
|
64
|
+
if key: # a description with no letters at all can't be matched with anything
|
|
65
|
+
groups[key].append(t)
|
|
66
|
+
|
|
67
|
+
found = []
|
|
68
|
+
for payments in groups.values():
|
|
69
|
+
months = {str(p["date"])[:7] for p in payments} # "2026-11-03" -> "2026-11"; a set keeps each month once
|
|
70
|
+
if len(months) < min_months:
|
|
71
|
+
continue
|
|
72
|
+
typical = round(median(p["amount_cents"] for p in payments)) # the middle amount, so one odd payment can't drag it
|
|
73
|
+
allowed = typical * tolerance_percent / 100 # how far an amount may be from the typical one
|
|
74
|
+
if any(abs(p["amount_cents"] - typical) > allowed for p in payments): # one amount too far off: not regular
|
|
75
|
+
continue
|
|
76
|
+
latest = max(payments, key=lambda p: str(p["date"])) # the most recent payment
|
|
77
|
+
found.append({
|
|
78
|
+
"description": latest["description"], # shown as the bank last wrote it
|
|
79
|
+
"category_id": latest["category_id"],
|
|
80
|
+
"amount_cents": typical,
|
|
81
|
+
"months": len(months),
|
|
82
|
+
"last_date": str(latest["date"]),
|
|
83
|
+
})
|
|
84
|
+
return sorted(found, key=lambda r: r["amount_cents"], reverse=True) # biggest first
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import datetime as dt
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from budget_analytics import (
|
|
6
|
+
budget_status,
|
|
7
|
+
find_recurring,
|
|
8
|
+
monthly_totals,
|
|
9
|
+
normalise_description,
|
|
10
|
+
spending_by_category,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def txn(amount_cents, kind="expense", category_id=1, date="2026-11-14", description="Tesco"):
|
|
15
|
+
# a normal transaction; a test only changes the part it cares about
|
|
16
|
+
return {"date": date, "description": description, "amount_cents": amount_cents, "type": kind,
|
|
17
|
+
"category_id": category_id}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# ---------- monthly_totals ----------
|
|
21
|
+
|
|
22
|
+
def test_monthly_totals_with_no_transactions():
|
|
23
|
+
assert monthly_totals([]) == {"income_cents": 0, "expenses_cents": 0, "balance_cents": 0}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def test_monthly_totals_adds_income_and_expenses_separately():
|
|
27
|
+
result = monthly_totals([txn(250000, kind="income"), txn(6435), txn(1200)])
|
|
28
|
+
assert result == {"income_cents": 250000, "expenses_cents": 7635, "balance_cents": 242365}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def test_monthly_totals_balance_can_go_negative():
|
|
32
|
+
assert monthly_totals([txn(1000, kind="income"), txn(1500)])["balance_cents"] == -500
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# ---------- spending_by_category ----------
|
|
36
|
+
|
|
37
|
+
def test_spending_by_category_with_no_transactions():
|
|
38
|
+
assert spending_by_category([]) == {}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def test_spending_by_category_totals_each_category():
|
|
42
|
+
transactions = [txn(12860, category_id=2), txn(4280, category_id=2), txn(6435, category_id=1)]
|
|
43
|
+
assert spending_by_category(transactions) == {2: 17140, 1: 6435}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def test_spending_by_category_ignores_income():
|
|
47
|
+
assert spending_by_category([txn(99999, kind="income"), txn(500)]) == {1: 500}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# ---------- budget_status ----------
|
|
51
|
+
|
|
52
|
+
@pytest.mark.parametrize("spent, status", [
|
|
53
|
+
(0, "ok"),
|
|
54
|
+
(7999, "ok"), # just under 80%
|
|
55
|
+
(8000, "warning"), # exactly 80%
|
|
56
|
+
(10000, "warning"), # exactly at the limit is not over
|
|
57
|
+
(10001, "over"), # 1 cent over
|
|
58
|
+
])
|
|
59
|
+
def test_budget_status_boundaries(spent, status):
|
|
60
|
+
assert budget_status(10000, spent)["status"] == status
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def test_budget_status_over_budget_example():
|
|
64
|
+
# the spec's Eating out example: 171.40 spent of 150.00
|
|
65
|
+
assert budget_status(15000, 17140) == {
|
|
66
|
+
"limit_cents": 15000, "spent_cents": 17140, "left_cents": -2140, "percent_used": 114, "status": "over",
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def test_budget_status_custom_warning_line():
|
|
71
|
+
assert budget_status(10000, 5000, warning_percent=50)["status"] == "warning"
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
@pytest.mark.parametrize("limit", [0, -100])
|
|
75
|
+
def test_budget_status_rejects_a_limit_of_zero_or_less(limit):
|
|
76
|
+
with pytest.raises(ValueError):
|
|
77
|
+
budget_status(limit, 100)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
# ---------- normalise_description ----------
|
|
81
|
+
|
|
82
|
+
@pytest.mark.parametrize("text, expected", [
|
|
83
|
+
("NETFLIX.COM 8472", "netflix com"),
|
|
84
|
+
("Netflix.com 9921", "netflix com"),
|
|
85
|
+
(" Rent - November ", "rent november"),
|
|
86
|
+
("12345", ""),
|
|
87
|
+
])
|
|
88
|
+
def test_normalise_description(text, expected):
|
|
89
|
+
assert normalise_description(text) == expected
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
# ---------- find_recurring ----------
|
|
93
|
+
|
|
94
|
+
def test_find_recurring_spots_a_monthly_subscription():
|
|
95
|
+
transactions = [
|
|
96
|
+
txn(1799, date="2026-09-03", description="NETFLIX.COM 1111"),
|
|
97
|
+
txn(1799, date="2026-10-03", description="NETFLIX.COM 2222"),
|
|
98
|
+
txn(1799, date="2026-11-03", description="Netflix.com 3333"),
|
|
99
|
+
]
|
|
100
|
+
assert find_recurring(transactions) == [{
|
|
101
|
+
"description": "Netflix.com 3333", "category_id": 1, "amount_cents": 1799, "months": 3,
|
|
102
|
+
"last_date": "2026-11-03",
|
|
103
|
+
}]
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def test_find_recurring_needs_three_different_months():
|
|
107
|
+
transactions = [txn(1799, date="2026-10-03", description="Netflix"),
|
|
108
|
+
txn(1799, date="2026-11-03", description="Netflix"),
|
|
109
|
+
txn(1799, date="2026-11-20", description="Netflix")] # 3 payments, but only 2 months
|
|
110
|
+
assert find_recurring(transactions) == []
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def test_find_recurring_allows_small_changes_in_the_amount():
|
|
114
|
+
# electricity: a little different every month, but within 10%
|
|
115
|
+
transactions = [txn(5000, date="2026-09-15", description="Electric Ireland"),
|
|
116
|
+
txn(5300, date="2026-10-15", description="Electric Ireland"),
|
|
117
|
+
txn(4800, date="2026-11-15", description="Electric Ireland")]
|
|
118
|
+
assert find_recurring(transactions)[0]["amount_cents"] == 5000 # the middle amount
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def test_find_recurring_rejects_amounts_that_vary_too_much():
|
|
122
|
+
# the same shop every month, but different baskets: not a regular payment
|
|
123
|
+
transactions = [txn(6435, date="2026-09-01"), txn(1200, date="2026-10-01"), txn(9900, date="2026-11-01")]
|
|
124
|
+
assert find_recurring(transactions) == []
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def test_find_recurring_ignores_income():
|
|
128
|
+
transactions = [txn(250000, kind="income", date=f"2026-{m}-28", description="Salary") for m in ("09", "10", "11")]
|
|
129
|
+
assert find_recurring(transactions) == []
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def test_find_recurring_sorts_biggest_first_and_accepts_date_objects():
|
|
133
|
+
transactions = []
|
|
134
|
+
for month in (9, 10, 11):
|
|
135
|
+
transactions.append(txn(1799, date=dt.date(2026, month, 3), description="Netflix"))
|
|
136
|
+
transactions.append(txn(120000, date=dt.date(2026, month, 1), description="Rent"))
|
|
137
|
+
assert [r["description"] for r in find_recurring(transactions)] == ["Rent", "Netflix"]
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def test_find_recurring_with_no_transactions():
|
|
141
|
+
assert find_recurring([]) == []
|