Personal finance in your terminal
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
Treeline
Personal finance analysis in your terminal
Treeline gives you complete control over your financial data. Built for power users who want direct access to their data.
⚠️ Early Stage Software: Treeline is in active development. While it's stable for personal use, expect potential breaking changes in future releases. Always back up your data.
If you've ever:
- Spent hours building a custom spreadsheet that could rival Mint
- Been frustrated with the lack of customization from existing finance tools
- Wished you build your own automations tailored to your financial life
- Wanted full control over your data
You're in the right place 😃
Features
- SQL Queries - Direct DuckDB access to your financial data
- SimpleFIN Sync - Automatic bank synchronization via SimpleFIN
- CSV Import - Import transactions from any bank CSV export, with automatic deduplication
- Local Database - All data stored locally in DuckDB
- Scriptable - JSON output, CSV export, and support for input / output piping
- Auto-Tagging - Python-based rules to build custom logic for automatically categorizing transactions
Quick Start
Try Demo Mode (No Setup)
The fastest way to explore Treeline:
pip install treeline-money
# Load demo data
export TREELINE_DEMO_MODE=true
treeline sync
# Explore with demo data
treeline status
treeline query "SELECT * FROM transactions LIMIT 10"
# When you're done with demoing:
unset TREELINE_DEMO_MODE
See docs/demo_mode.md for details.
Real Setup
# 1. Install
pip install treeline-money
# 2. Connect to SimpleFIN
treeline setup simplefin
# 3. Sync your data
treeline sync
# 4. Start exploring
treeline status
treeline query "SELECT * FROM transactions ORDER BY transaction_date DESC LIMIT 10"
Tagging transactions
# Start interactive tagging mode
treeline tag
# Or tag directly from CLI
treeline tag apply --ids abc123,def456 groceries,food
# Or pipe IDs from query to apply tags in bulk
# Note: Use intermediate variable to avoid database lock conflicts
TX_IDS=$(treeline query "SELECT transaction_id FROM transactions WHERE description ILIKE '%QFC%'" --json | jq -r '.rows[][]')
echo "$TX_IDS" | treeline tag apply groceries
Auto-tagging rules on sync or import
treeline new tagger large_purchases
This will create a new file in ~/.treeline/taggers/large_purchases.py. Fill out the Python logic, then test by doing a backfill with optional --dry-run flag:
treeline backfill tags --dry-run --verbose
This will show the tags that would be applied, but makes no edits to the database. Remove the the --dry-run once you're confident in the logic.
Database Schema
Query these tables with standard SQL:
transactions
Main view for querying transaction data (joins transaction + account details):
transaction_id- UUID of transactionaccount_id- UUID of accountamount- Transaction amount (negative = spending, positive = income)description- Transaction descriptiontransaction_date- Date of transactionposted_date- Date transaction postedtags- Array of tags (e.g.,['groceries', 'food'])account_name- Name of account (joined)account_type- Type of account (joined)currency- Currency code (joined)institution_name- Bank/institution name (joined)
accounts
Account information:
account_id- UUID of accountname- Account namenickname- Optional nicknameaccount_type- Account type (checking, savings, credit, etc.)currency- Currency code (default: USD)balance- Current balanceexternal_ids- JSON of external IDs from integrationsinstitution_name- Bank/institution nameinstitution_url- Institution URLinstitution_domain- Institution domaincreated_at- Created timestampupdated_at- Last updated timestamp
balance_snapshots
Historical balance data (joins balance + account details):
snapshot_id- UUID of snapshotaccount_id- UUID of accountbalance- Balance at snapshot timesnapshot_time- When snapshot was takenaccount_name- Name of account (joined)institution_name- Bank/institution name (joined)created_at- Created timestampupdated_at- Last updated timestamp
Example queries:
# Spending by tag
treeline query "SELECT tags, SUM(amount) as total FROM transactions WHERE amount < 0 GROUP BY tags ORDER BY total"
# Monthly spending trends
treeline query "SELECT strftime('%Y-%m', transaction_date) as month, SUM(amount) as total FROM transactions WHERE amount < 0 GROUP BY month ORDER BY month DESC"
# Account balances over time
treeline query "SELECT account_name, snapshot_time, balance FROM balance_snapshots ORDER BY snapshot_time DESC"
# Top 10 biggest purchases
treeline query "SELECT transaction_date, description, amount, account_name FROM transactions WHERE amount < 0 ORDER BY amount LIMIT 10"
# Transactions without tags
treeline query "SELECT transaction_date, description, amount FROM transactions WHERE tags = [] ORDER BY transaction_date DESC LIMIT 20"
# Export all transactions to CSV
treeline query "SELECT * FROM transactions" --format csv > all_transactions.csv
What can you do with Treeline?
Some ideas to get you started:
- Build an interactive dashboard with Marimo or Streamlit (or whatever your favorite tool is)
- Have Claude Code analyze your data with natural language by letting it run Treeline CLI commands. Note: by default Claude won't know the DB schema. Point it to this README and it should be able to explore your data and analyze it.
- Automatically parse bank statements, format as CSV, then import into Treeline
- Train an ML model on your data to tag transactions, then use the ML model in a automatic tagger (see
treeline new tagger --help) - Setup a cron job to run
treeline syncdaily - Setup a cron job to backup your data into Google Drive or Dropbox
Getting Help
- Bug reports & feature requests: GitHub Issues
- Questions & discussions: GitHub Discussions
When filing a bug report, please include:
- Your operating system and Python version
- The command you ran
- The full error message or unexpected behavior
- Steps to reproduce the issue
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file treeline_money-0.1.1.tar.gz.
File metadata
- Download URL: treeline_money-0.1.1.tar.gz
- Upload date:
- Size: 61.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c98c06d3f5466803c7451c51189c7e72477a3d6b2417cd4b1921c6df3bf40416
|
|
| MD5 |
99f69136eabd06992a592f0177fb4f06
|
|
| BLAKE2b-256 |
63bb5c5f0611f6d9ec0886b486483832803b99e27f2eeb083fe86b54dbf0f9cc
|
File details
Details for the file treeline_money-0.1.1-py3-none-any.whl.
File metadata
- Download URL: treeline_money-0.1.1-py3-none-any.whl
- Upload date:
- Size: 67.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5faf3f195d7bcb294ea0fbb73f600ba13961f822f8d206d27a0803f5a7ed72cd
|
|
| MD5 |
4960cef9ec0a93a1e3cb7fdade045ed5
|
|
| BLAKE2b-256 |
5298ba48e3efd59f264980da53d3ba93c16b38a0841abbaa0f53be54481c37af
|