finn-tracker 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.
- finn_tracker-0.1.0/LICENSE +21 -0
- finn_tracker-0.1.0/PKG-INFO +276 -0
- finn_tracker-0.1.0/README.md +245 -0
- finn_tracker-0.1.0/finn_tracker/__init__.py +0 -0
- finn_tracker-0.1.0/finn_tracker/__main__.py +176 -0
- finn_tracker-0.1.0/finn_tracker/dashboard/index.html +1985 -0
- finn_tracker-0.1.0/finn_tracker.egg-info/PKG-INFO +276 -0
- finn_tracker-0.1.0/finn_tracker.egg-info/SOURCES.txt +19 -0
- finn_tracker-0.1.0/finn_tracker.egg-info/dependency_links.txt +1 -0
- finn_tracker-0.1.0/finn_tracker.egg-info/entry_points.txt +2 -0
- finn_tracker-0.1.0/finn_tracker.egg-info/requires.txt +10 -0
- finn_tracker-0.1.0/finn_tracker.egg-info/top_level.txt +2 -0
- finn_tracker-0.1.0/pyproject.toml +49 -0
- finn_tracker-0.1.0/sample_data/__init__.py +0 -0
- finn_tracker-0.1.0/sample_data/generators.py +224 -0
- finn_tracker-0.1.0/setup.cfg +4 -0
- finn_tracker-0.1.0/tests/test_app.py +1418 -0
- finn_tracker-0.1.0/tests/test_cli.py +209 -0
- finn_tracker-0.1.0/tests/test_db.py +557 -0
- finn_tracker-0.1.0/tests/test_ingest.py +228 -0
- finn_tracker-0.1.0/tests/test_pdf_parser.py +416 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rachith P
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: finn-tracker
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Privacy-first local expense tracker — import bank CSVs/PDFs, auto-categorize, explore trends. No data ever leaves your machine.
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/RachithP/finn-tracker
|
|
7
|
+
Project-URL: Issues, https://github.com/RachithP/finn-tracker/issues
|
|
8
|
+
Keywords: finance,expense,privacy,local,csv,pdf
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: flask<4,>=3.0
|
|
22
|
+
Requires-Dist: pdfplumber<1,>=0.11
|
|
23
|
+
Requires-Dist: pandas>=1.5
|
|
24
|
+
Requires-Dist: pypdf>=3.0
|
|
25
|
+
Requires-Dist: reportlab>=4.0
|
|
26
|
+
Requires-Dist: requests>=2.28
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# finn-tracker
|
|
33
|
+
|
|
34
|
+
[](https://github.com/RachithP/finn-tracker/actions/workflows/ci.yml)
|
|
35
|
+
[](https://github.com/RachithP/finn-tracker/actions/workflows/ci.yml)
|
|
36
|
+
[](https://python.org)
|
|
37
|
+
[](LICENSE)
|
|
38
|
+
|
|
39
|
+
A fully local expense tracking and visualization tool. Import bank CSVs and PDF statements, auto-categorize transactions, and explore spending trends through an interactive dashboard. **No data ever leaves your machine.**
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
- **Auto-import** — drop CSVs/PDFs into `~/Documents/finn-tracker/expense/` (or `income/`) and they load automatically on every page refresh
|
|
46
|
+
- **Smart categorization** — static rules auto-categorize common merchants; manual overrides are persisted and learned
|
|
47
|
+
- **Interactive dashboard** — summary cards, spending-by-category bar chart, account donut chart, spending trend timeline, and category drill-down
|
|
48
|
+
- **Period filtering** — 1M, 3M, 6M, YTD, This Month, Last Month, All, or a custom date range
|
|
49
|
+
- **Export** — CSV or PDF report with masked merchant names
|
|
50
|
+
- **AI chat assistant** — ask questions about your spending in plain English ("How much did I spend on food last month?"). Powered by a local LLM ([llama.cpp](https://github.com/ggerganov/llama.cpp)) — your data never leaves your machine
|
|
51
|
+
- **MCP server** — connect Claude Desktop, Cursor, Kiro, and other AI tools directly to your expense data via the [Model Context Protocol](https://modelcontextprotocol.io)
|
|
52
|
+
- **Privacy-first** — server binds to `127.0.0.1` only; all state stored in a local SQLite DB; sensitive strings masked before any API response
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Quick Start
|
|
57
|
+
|
|
58
|
+
### Step 1 — Install Python (if you haven't already)
|
|
59
|
+
|
|
60
|
+
finn-tracker requires Python 3.9 or later. Check if you have it:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
python3 --version
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
If you see `Python 3.9` or higher, skip to Step 2. Otherwise, install it:
|
|
67
|
+
|
|
68
|
+
- **macOS**: [Download from python.org](https://python.org/downloads) or run `brew install python`
|
|
69
|
+
- **Ubuntu/Debian**: `sudo apt install python3`
|
|
70
|
+
|
|
71
|
+
> **Note:** finn-tracker is developed and tested on macOS and Ubuntu. It may work on other platforms but is not officially supported on Windows.
|
|
72
|
+
|
|
73
|
+
### Step 2 — Install finn-tracker
|
|
74
|
+
|
|
75
|
+
Open a terminal and run:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pip install finn-tracker
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
> **Tip:** If `pip` isn't found, try `pip3 install finn-tracker` or `python3 -m pip install finn-tracker`.
|
|
82
|
+
|
|
83
|
+
> **Optional — use a virtual environment:** If you want to keep finn-tracker isolated from other Python packages, create a virtual environment first:
|
|
84
|
+
> ```bash
|
|
85
|
+
> python3 -m venv ~/.venvs/finn-tracker
|
|
86
|
+
> source ~/.venvs/finn-tracker/bin/activate
|
|
87
|
+
> pip install finn-tracker
|
|
88
|
+
> ```
|
|
89
|
+
> You'll need to activate the environment (`source ~/.venvs/finn-tracker/bin/activate`) each time before running `finn-tracker`.
|
|
90
|
+
|
|
91
|
+
### Step 3 — Launch
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
finn-tracker
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Your browser opens automatically at `http://localhost:5050`.
|
|
98
|
+
|
|
99
|
+
### Step 4 — Add your bank statements
|
|
100
|
+
|
|
101
|
+
Drop your bank CSV or PDF exports into:
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
~/Documents/finn-tracker/expense/ ← charges, debits
|
|
105
|
+
~/Documents/finn-tracker/income/ ← salary, deposits
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Then refresh the page — your transactions appear automatically.
|
|
109
|
+
|
|
110
|
+
> **Not sure where to find those folders?**
|
|
111
|
+
> - **macOS**: Open Finder, press **⌘ Shift H** to go to your home folder, then open `Documents → finn-tracker`.
|
|
112
|
+
> - **Linux**: Open your file manager and navigate to `~/Documents/finn-tracker/`.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### Try it first with sample data
|
|
117
|
+
|
|
118
|
+
Not ready to import real statements yet? Run this to load synthetic demo data:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
finn-tracker --demo
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Privacy Guarantee
|
|
127
|
+
|
|
128
|
+
No data leaves your machine. finn-tracker:
|
|
129
|
+
|
|
130
|
+
- Runs at `127.0.0.1:5050` — not accessible from the network by default
|
|
131
|
+
- Stores everything in SQLite on your disk (`~/Documents/finn-tracker/finn_tracker.db`)
|
|
132
|
+
- Never makes outbound network calls
|
|
133
|
+
- Deletes uploaded files immediately after parsing
|
|
134
|
+
- Masks card numbers, SSNs, and account numbers in all API responses
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## AI Chat Assistant
|
|
139
|
+
|
|
140
|
+
finn-tracker includes a built-in chat assistant that answers questions about your spending in plain English:
|
|
141
|
+
|
|
142
|
+
> "How much did I spend on groceries last month?"
|
|
143
|
+
> "What's my biggest expense category this year?"
|
|
144
|
+
> "Show me my top 5 merchants"
|
|
145
|
+
> "Filter the dashboard to last month"
|
|
146
|
+
> "Which transactions are uncategorized?"
|
|
147
|
+
|
|
148
|
+
The assistant can answer spending questions and control the dashboard — filtering by period or category on your behalf. It runs entirely on your machine using [llama.cpp](https://github.com/ggerganov/llama.cpp). No data is sent to any external service.
|
|
149
|
+
|
|
150
|
+
**To enable it:**
|
|
151
|
+
|
|
152
|
+
1. Install and start [llama-server](https://github.com/ggerganov/llama.cpp#quick-start) on port 8080 (the default)
|
|
153
|
+
2. Launch finn-tracker — the chat button in the top-right corner will show **AI Ready**
|
|
154
|
+
|
|
155
|
+
To use a different port: `LLAMA_CPP_URL=http://localhost:8081 finn-tracker`
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## MCP Server (Claude Desktop, Cursor, Kiro)
|
|
160
|
+
|
|
161
|
+
finn-tracker ships an [MCP server](https://modelcontextprotocol.io) that lets AI tools query your expense data directly — no browser required.
|
|
162
|
+
|
|
163
|
+
**To connect Claude Desktop:**
|
|
164
|
+
|
|
165
|
+
Add this to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"mcpServers": {
|
|
170
|
+
"finn-tracker": {
|
|
171
|
+
"command": "/path/to/your/python",
|
|
172
|
+
"args": ["/path/to/finn-tracker/mcp_server.py"]
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Once connected, you can ask Claude things like "summarize my spending this month" or "what did I spend on dining last quarter" directly in Claude Desktop.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Supported File Formats
|
|
183
|
+
|
|
184
|
+
| Format | Auto-detected banks |
|
|
185
|
+
|---|---|
|
|
186
|
+
| CSV | Chase Bank (checking), Chase Credit, Bank of America, Capital One, generic |
|
|
187
|
+
| PDF | Table-based and text-fallback extraction (pdfplumber) |
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## How It Works
|
|
192
|
+
|
|
193
|
+
### Data flow
|
|
194
|
+
1. Files in `~/Documents/finn-tracker/expense/` and `income/` are parsed on every `GET /transactions` request.
|
|
195
|
+
2. Manually imported files (via the dashboard) are parsed once and persisted to SQLite.
|
|
196
|
+
3. All transactions are deduplicated by a stable hash of `(date, merchant, amount, account)`.
|
|
197
|
+
4. Category overrides and learned merchant rules survive server restarts via SQLite.
|
|
198
|
+
|
|
199
|
+
### Category learning
|
|
200
|
+
When you manually categorize a transaction, the app extracts a normalized merchant pattern and saves it as a rule. Future transactions matching that pattern are auto-categorized.
|
|
201
|
+
|
|
202
|
+
### Sign convention
|
|
203
|
+
`amount` is **negative for charges/debits, positive for credits/payments** — consistent throughout parsers and the frontend.
|
|
204
|
+
|
|
205
|
+
### Resetting your data
|
|
206
|
+
|
|
207
|
+
Two buttons in the top-right corner of the dashboard let you clear data at different scopes:
|
|
208
|
+
|
|
209
|
+
| Button | What it clears | What it keeps |
|
|
210
|
+
|---|---|---|
|
|
211
|
+
| **🗑 Clear Session** | Transactions imported during the current run (via the dashboard's import button) | Auto-scan folders, SQLite data, learned rules, category overrides |
|
|
212
|
+
| **🗑 Clear All** | Everything in SQLite — all transactions, category overrides, and learned merchant rules | Your original CSV/PDF files (they reload from auto-scan folders on next refresh) |
|
|
213
|
+
|
|
214
|
+
Use **Clear Session** to undo a bad import without losing your history. Use **Clear All** to start completely fresh. Both actions ask for confirmation before proceeding.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Running Tests
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
pip install finn-tracker[dev]
|
|
222
|
+
python -m pytest tests/ -v
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
324 tests across five files:
|
|
226
|
+
- `tests/test_app.py` — parsers, Flask routes, persistence, privacy masking, AI chat endpoints
|
|
227
|
+
- `tests/test_cli.py` — CLI entry point, packaging, data directory setup
|
|
228
|
+
- `tests/test_db.py` — shared data access layer, analytics, period filtering, folder scanning
|
|
229
|
+
- `tests/test_ingest.py` — file routing, multi-file ingestion, merge, summary
|
|
230
|
+
- `tests/test_pdf_parser.py` — PDF statement parsing, account detection, table/text extraction
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Platform Support
|
|
235
|
+
|
|
236
|
+
finn-tracker is developed and tested on **macOS** and **Ubuntu Linux**. CI runs on both platforms across Python 3.9, 3.11, and 3.12. Other Unix-like systems should work but are not officially tested. Windows is not supported.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Project Structure
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
app.py Flask backend + SQLite persistence
|
|
244
|
+
ingest.py Routes .csv/.pdf files to the correct parser
|
|
245
|
+
models.py Transaction dataclass, ParseResult, mask_sensitive()
|
|
246
|
+
mcp_server.py MCP server for Claude Desktop, Claude Code, Cursor, Kiro
|
|
247
|
+
parsers/
|
|
248
|
+
csv_parser.py Auto-detects Chase Bank, Chase Credit, BofA, Capital One, generic CSV
|
|
249
|
+
pdf_parser.py Table + text-fallback extraction (pdfplumber)
|
|
250
|
+
utils/
|
|
251
|
+
db.py Shared data-access layer (no Flask import) — used by app.py and mcp_server.py
|
|
252
|
+
finn_tracker/
|
|
253
|
+
__main__.py CLI entry point (finn-tracker command)
|
|
254
|
+
dashboard/
|
|
255
|
+
index.html Entire frontend — vanilla JS, no build step
|
|
256
|
+
sample_data/
|
|
257
|
+
generators.py Synthetic CSV fixtures for tests and --demo mode
|
|
258
|
+
tests/
|
|
259
|
+
test_app.py Tests covering parsers, Flask routes, persistence, privacy masking
|
|
260
|
+
test_cli.py Tests covering CLI entry point, packaging, data directory setup
|
|
261
|
+
test_db.py Tests covering shared data access layer, analytics, filtering
|
|
262
|
+
test_ingest.py Tests covering file routing, multi-file ingestion, merge
|
|
263
|
+
test_pdf_parser.py Tests covering PDF parsing, account detection, table/text extraction
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Data lives in `~/Documents/finn-tracker/` (created on first run, never in the install directory).
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Contributing
|
|
271
|
+
|
|
272
|
+
Found a bug or want to add a bank parser? See [CONTRIBUTING.md](CONTRIBUTING.md) for how to get started.
|
|
273
|
+
|
|
274
|
+
For performance optimization guidance when scaling beyond 10K transactions, see [SCALING.md](SCALING.md).
|
|
275
|
+
|
|
276
|
+
[Open an issue on GitHub](https://github.com/RachithP/finn-tracker/issues) — include the output of `finn-tracker --version`.
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
# finn-tracker
|
|
2
|
+
|
|
3
|
+
[](https://github.com/RachithP/finn-tracker/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/RachithP/finn-tracker/actions/workflows/ci.yml)
|
|
5
|
+
[](https://python.org)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
A fully local expense tracking and visualization tool. Import bank CSVs and PDF statements, auto-categorize transactions, and explore spending trends through an interactive dashboard. **No data ever leaves your machine.**
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- **Auto-import** — drop CSVs/PDFs into `~/Documents/finn-tracker/expense/` (or `income/`) and they load automatically on every page refresh
|
|
15
|
+
- **Smart categorization** — static rules auto-categorize common merchants; manual overrides are persisted and learned
|
|
16
|
+
- **Interactive dashboard** — summary cards, spending-by-category bar chart, account donut chart, spending trend timeline, and category drill-down
|
|
17
|
+
- **Period filtering** — 1M, 3M, 6M, YTD, This Month, Last Month, All, or a custom date range
|
|
18
|
+
- **Export** — CSV or PDF report with masked merchant names
|
|
19
|
+
- **AI chat assistant** — ask questions about your spending in plain English ("How much did I spend on food last month?"). Powered by a local LLM ([llama.cpp](https://github.com/ggerganov/llama.cpp)) — your data never leaves your machine
|
|
20
|
+
- **MCP server** — connect Claude Desktop, Cursor, Kiro, and other AI tools directly to your expense data via the [Model Context Protocol](https://modelcontextprotocol.io)
|
|
21
|
+
- **Privacy-first** — server binds to `127.0.0.1` only; all state stored in a local SQLite DB; sensitive strings masked before any API response
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
### Step 1 — Install Python (if you haven't already)
|
|
28
|
+
|
|
29
|
+
finn-tracker requires Python 3.9 or later. Check if you have it:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
python3 --version
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If you see `Python 3.9` or higher, skip to Step 2. Otherwise, install it:
|
|
36
|
+
|
|
37
|
+
- **macOS**: [Download from python.org](https://python.org/downloads) or run `brew install python`
|
|
38
|
+
- **Ubuntu/Debian**: `sudo apt install python3`
|
|
39
|
+
|
|
40
|
+
> **Note:** finn-tracker is developed and tested on macOS and Ubuntu. It may work on other platforms but is not officially supported on Windows.
|
|
41
|
+
|
|
42
|
+
### Step 2 — Install finn-tracker
|
|
43
|
+
|
|
44
|
+
Open a terminal and run:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install finn-tracker
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
> **Tip:** If `pip` isn't found, try `pip3 install finn-tracker` or `python3 -m pip install finn-tracker`.
|
|
51
|
+
|
|
52
|
+
> **Optional — use a virtual environment:** If you want to keep finn-tracker isolated from other Python packages, create a virtual environment first:
|
|
53
|
+
> ```bash
|
|
54
|
+
> python3 -m venv ~/.venvs/finn-tracker
|
|
55
|
+
> source ~/.venvs/finn-tracker/bin/activate
|
|
56
|
+
> pip install finn-tracker
|
|
57
|
+
> ```
|
|
58
|
+
> You'll need to activate the environment (`source ~/.venvs/finn-tracker/bin/activate`) each time before running `finn-tracker`.
|
|
59
|
+
|
|
60
|
+
### Step 3 — Launch
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
finn-tracker
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Your browser opens automatically at `http://localhost:5050`.
|
|
67
|
+
|
|
68
|
+
### Step 4 — Add your bank statements
|
|
69
|
+
|
|
70
|
+
Drop your bank CSV or PDF exports into:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
~/Documents/finn-tracker/expense/ ← charges, debits
|
|
74
|
+
~/Documents/finn-tracker/income/ ← salary, deposits
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Then refresh the page — your transactions appear automatically.
|
|
78
|
+
|
|
79
|
+
> **Not sure where to find those folders?**
|
|
80
|
+
> - **macOS**: Open Finder, press **⌘ Shift H** to go to your home folder, then open `Documents → finn-tracker`.
|
|
81
|
+
> - **Linux**: Open your file manager and navigate to `~/Documents/finn-tracker/`.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### Try it first with sample data
|
|
86
|
+
|
|
87
|
+
Not ready to import real statements yet? Run this to load synthetic demo data:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
finn-tracker --demo
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Privacy Guarantee
|
|
96
|
+
|
|
97
|
+
No data leaves your machine. finn-tracker:
|
|
98
|
+
|
|
99
|
+
- Runs at `127.0.0.1:5050` — not accessible from the network by default
|
|
100
|
+
- Stores everything in SQLite on your disk (`~/Documents/finn-tracker/finn_tracker.db`)
|
|
101
|
+
- Never makes outbound network calls
|
|
102
|
+
- Deletes uploaded files immediately after parsing
|
|
103
|
+
- Masks card numbers, SSNs, and account numbers in all API responses
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## AI Chat Assistant
|
|
108
|
+
|
|
109
|
+
finn-tracker includes a built-in chat assistant that answers questions about your spending in plain English:
|
|
110
|
+
|
|
111
|
+
> "How much did I spend on groceries last month?"
|
|
112
|
+
> "What's my biggest expense category this year?"
|
|
113
|
+
> "Show me my top 5 merchants"
|
|
114
|
+
> "Filter the dashboard to last month"
|
|
115
|
+
> "Which transactions are uncategorized?"
|
|
116
|
+
|
|
117
|
+
The assistant can answer spending questions and control the dashboard — filtering by period or category on your behalf. It runs entirely on your machine using [llama.cpp](https://github.com/ggerganov/llama.cpp). No data is sent to any external service.
|
|
118
|
+
|
|
119
|
+
**To enable it:**
|
|
120
|
+
|
|
121
|
+
1. Install and start [llama-server](https://github.com/ggerganov/llama.cpp#quick-start) on port 8080 (the default)
|
|
122
|
+
2. Launch finn-tracker — the chat button in the top-right corner will show **AI Ready**
|
|
123
|
+
|
|
124
|
+
To use a different port: `LLAMA_CPP_URL=http://localhost:8081 finn-tracker`
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## MCP Server (Claude Desktop, Cursor, Kiro)
|
|
129
|
+
|
|
130
|
+
finn-tracker ships an [MCP server](https://modelcontextprotocol.io) that lets AI tools query your expense data directly — no browser required.
|
|
131
|
+
|
|
132
|
+
**To connect Claude Desktop:**
|
|
133
|
+
|
|
134
|
+
Add this to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"mcpServers": {
|
|
139
|
+
"finn-tracker": {
|
|
140
|
+
"command": "/path/to/your/python",
|
|
141
|
+
"args": ["/path/to/finn-tracker/mcp_server.py"]
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Once connected, you can ask Claude things like "summarize my spending this month" or "what did I spend on dining last quarter" directly in Claude Desktop.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Supported File Formats
|
|
152
|
+
|
|
153
|
+
| Format | Auto-detected banks |
|
|
154
|
+
|---|---|
|
|
155
|
+
| CSV | Chase Bank (checking), Chase Credit, Bank of America, Capital One, generic |
|
|
156
|
+
| PDF | Table-based and text-fallback extraction (pdfplumber) |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## How It Works
|
|
161
|
+
|
|
162
|
+
### Data flow
|
|
163
|
+
1. Files in `~/Documents/finn-tracker/expense/` and `income/` are parsed on every `GET /transactions` request.
|
|
164
|
+
2. Manually imported files (via the dashboard) are parsed once and persisted to SQLite.
|
|
165
|
+
3. All transactions are deduplicated by a stable hash of `(date, merchant, amount, account)`.
|
|
166
|
+
4. Category overrides and learned merchant rules survive server restarts via SQLite.
|
|
167
|
+
|
|
168
|
+
### Category learning
|
|
169
|
+
When you manually categorize a transaction, the app extracts a normalized merchant pattern and saves it as a rule. Future transactions matching that pattern are auto-categorized.
|
|
170
|
+
|
|
171
|
+
### Sign convention
|
|
172
|
+
`amount` is **negative for charges/debits, positive for credits/payments** — consistent throughout parsers and the frontend.
|
|
173
|
+
|
|
174
|
+
### Resetting your data
|
|
175
|
+
|
|
176
|
+
Two buttons in the top-right corner of the dashboard let you clear data at different scopes:
|
|
177
|
+
|
|
178
|
+
| Button | What it clears | What it keeps |
|
|
179
|
+
|---|---|---|
|
|
180
|
+
| **🗑 Clear Session** | Transactions imported during the current run (via the dashboard's import button) | Auto-scan folders, SQLite data, learned rules, category overrides |
|
|
181
|
+
| **🗑 Clear All** | Everything in SQLite — all transactions, category overrides, and learned merchant rules | Your original CSV/PDF files (they reload from auto-scan folders on next refresh) |
|
|
182
|
+
|
|
183
|
+
Use **Clear Session** to undo a bad import without losing your history. Use **Clear All** to start completely fresh. Both actions ask for confirmation before proceeding.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Running Tests
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
pip install finn-tracker[dev]
|
|
191
|
+
python -m pytest tests/ -v
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
324 tests across five files:
|
|
195
|
+
- `tests/test_app.py` — parsers, Flask routes, persistence, privacy masking, AI chat endpoints
|
|
196
|
+
- `tests/test_cli.py` — CLI entry point, packaging, data directory setup
|
|
197
|
+
- `tests/test_db.py` — shared data access layer, analytics, period filtering, folder scanning
|
|
198
|
+
- `tests/test_ingest.py` — file routing, multi-file ingestion, merge, summary
|
|
199
|
+
- `tests/test_pdf_parser.py` — PDF statement parsing, account detection, table/text extraction
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Platform Support
|
|
204
|
+
|
|
205
|
+
finn-tracker is developed and tested on **macOS** and **Ubuntu Linux**. CI runs on both platforms across Python 3.9, 3.11, and 3.12. Other Unix-like systems should work but are not officially tested. Windows is not supported.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Project Structure
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
app.py Flask backend + SQLite persistence
|
|
213
|
+
ingest.py Routes .csv/.pdf files to the correct parser
|
|
214
|
+
models.py Transaction dataclass, ParseResult, mask_sensitive()
|
|
215
|
+
mcp_server.py MCP server for Claude Desktop, Claude Code, Cursor, Kiro
|
|
216
|
+
parsers/
|
|
217
|
+
csv_parser.py Auto-detects Chase Bank, Chase Credit, BofA, Capital One, generic CSV
|
|
218
|
+
pdf_parser.py Table + text-fallback extraction (pdfplumber)
|
|
219
|
+
utils/
|
|
220
|
+
db.py Shared data-access layer (no Flask import) — used by app.py and mcp_server.py
|
|
221
|
+
finn_tracker/
|
|
222
|
+
__main__.py CLI entry point (finn-tracker command)
|
|
223
|
+
dashboard/
|
|
224
|
+
index.html Entire frontend — vanilla JS, no build step
|
|
225
|
+
sample_data/
|
|
226
|
+
generators.py Synthetic CSV fixtures for tests and --demo mode
|
|
227
|
+
tests/
|
|
228
|
+
test_app.py Tests covering parsers, Flask routes, persistence, privacy masking
|
|
229
|
+
test_cli.py Tests covering CLI entry point, packaging, data directory setup
|
|
230
|
+
test_db.py Tests covering shared data access layer, analytics, filtering
|
|
231
|
+
test_ingest.py Tests covering file routing, multi-file ingestion, merge
|
|
232
|
+
test_pdf_parser.py Tests covering PDF parsing, account detection, table/text extraction
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Data lives in `~/Documents/finn-tracker/` (created on first run, never in the install directory).
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## Contributing
|
|
240
|
+
|
|
241
|
+
Found a bug or want to add a bank parser? See [CONTRIBUTING.md](CONTRIBUTING.md) for how to get started.
|
|
242
|
+
|
|
243
|
+
For performance optimization guidance when scaling beyond 10K transactions, see [SCALING.md](SCALING.md).
|
|
244
|
+
|
|
245
|
+
[Open an issue on GitHub](https://github.com/RachithP/finn-tracker/issues) — include the output of `finn-tracker --version`.
|
|
File without changes
|