Skip to main content

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 transaction
  • account_id - UUID of account
  • amount - Transaction amount (negative = spending, positive = income)
  • description - Transaction description
  • transaction_date - Date of transaction
  • posted_date - Date transaction posted
  • tags - 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 account
  • name - Account name
  • nickname - Optional nickname
  • account_type - Account type (checking, savings, credit, etc.)
  • currency - Currency code (default: USD)
  • balance - Current balance
  • external_ids - JSON of external IDs from integrations
  • institution_name - Bank/institution name
  • institution_url - Institution URL
  • institution_domain - Institution domain
  • created_at - Created timestamp
  • updated_at - Last updated timestamp

balance_snapshots

Historical balance data (joins balance + account details):

  • snapshot_id - UUID of snapshot
  • account_id - UUID of account
  • balance - Balance at snapshot time
  • snapshot_time - When snapshot was taken
  • account_name - Name of account (joined)
  • institution_name - Bank/institution name (joined)
  • created_at - Created timestamp
  • updated_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 sync daily
  • Setup a cron job to backup your data into Google Drive or Dropbox

Getting Help

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

treeline_money-0.1.7.tar.gz (61.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

treeline_money-0.1.7-py3-none-any.whl (67.7 kB view details)

Uploaded Python 3

File details

Details for the file treeline_money-0.1.7.tar.gz.

File metadata

  • Download URL: treeline_money-0.1.7.tar.gz
  • Upload date:
  • Size: 61.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for treeline_money-0.1.7.tar.gz
Algorithm Hash digest
SHA256 7c834eb4f0f58dcb6a893b2e03563910c9d880524ae2ab46d9c44c1da08c4f01
MD5 3a2b0429e3c03cc07e8e0570900463b9
BLAKE2b-256 2031e54f05ff684cf36da939b0963c917b14a8a5e246afd8cbb844e3882cf23d

See more details on using hashes here.

Provenance

The following attestation bundles were made for treeline_money-0.1.7.tar.gz:

Publisher: publish.yml on zack-schrag/treeline-money

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file treeline_money-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: treeline_money-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 67.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for treeline_money-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e0dae3593465ca0f737117bcb9ad183d127d65840efe03727d9f446b8f1e9ae3
MD5 3ebc3801ed94bde33db52f0cf8e7743a
BLAKE2b-256 6339f2b28e73bf4abcba3ac083fa2d632c749507643a0cf78504088f07b51da9

See more details on using hashes here.

Provenance

The following attestation bundles were made for treeline_money-0.1.7-py3-none-any.whl:

Publisher: publish.yml on zack-schrag/treeline-money

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page