gitwtfhub

wtf is ynab-sqlite-export?

rubick/ynab-sqlite-export — explained in plain English

Analysis updated 2026-05-18

9PythonAudience · generalComplexity · 2/5LicenseSetup · easy

TL;DR

A zero dependency Python script that copies your entire YNAB budget into a local SQLite file, updating incrementally so you can query your finances with SQL.

Mindmap

mindmap
  root((ynab-sqlite-export))
    What it does
      Dumps YNAB to SQLite
      Incremental sync
      Zero dependencies
    Tech stack
      Python standard library
      SQLite database
    Use cases
      SQL spending queries
      Scheduled cron sync
      AI agent data access
    Data
      Budgets and accounts
      Categories and payees
      Transactions and splits
    Audience
      YNAB users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Query your full YNAB spending history with plain SQL instead of the app's built in reports.

REASON 2

Schedule an hourly sync of your YNAB budget into a local database with cron or GitHub Actions.

REASON 3

Analyze spending by category or find your most frequent payees using example SQL queries.

REASON 4

Give an AI coding assistant like Claude Code safe, accurate access to your budgeting data.

What's in the stack?

PythonSQLite

How it stacks up

rubick/ynab-sqlite-exportalirezarezvani/promptorayushk58/crawlyx
Stars999
LanguagePythonPythonPython
Last pushed2025-09-14
MaintenanceQuiet
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencegeneralpm founderpm founder

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Requires a YNAB account and a personal access token generated from YNAB's developer settings page.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

Wtf does this do

This tool copies your entire YNAB budgeting account, every budget, account, category, payee, and transaction, into a local SQLite database file on your own computer. YNAB is a popular budgeting app, and this script exists because its built in reporting only shows you what the app's own screens let you see. Once your data sits in a plain SQLite file, you can query it with ordinary SQL, open it in a free tool like DB Browser for SQLite, or feed it into something like a spreadsheet or a chart tool. It is written in pure Python with no external packages needed at all, using only things already built into Python itself. You run one script, it reads a personal access token you generate from YNAB's own settings page, and it writes or updates a file called ynab.db. The first run pulls everything, but every run after that only fetches what changed since last time, using a cursor YNAB provides for this purpose, so you can safely schedule it hourly with something like cron without wasting API calls or your time. The data is organized into clear tables: budgets, accounts, category groups and categories, payees, transactions, and the smaller split pieces of transactions that are divided across categories. All dollar amounts are converted from YNAB's internal counting format into normal decimal numbers. The README includes example SQL queries, such as finding your top spending categories over the last three months or your most frequent payees. This is a one way sync from YNAB down to your local file. Any changes made directly to the SQLite database are never sent back up to YNAB or reconciled against it, so think of it purely as a read only mirror of your account. The project also ships built in guidance for AI coding assistants like Claude Code, so an assistant can correctly answer questions about your spending without tripping over details like soft deleted rows or split transactions. The script is released under the MIT License, a permissive license that allows commercial use as long as the copyright notice stays intact, and it respects YNAB's API rate limits by using only a handful of requests per budget on each run.

Yoink these prompts

Prompt 1
Walk me through generating a YNAB personal access token and running this script for the first time.
Prompt 2
Explain how the incremental sync in this script avoids re-fetching unchanged data.
Prompt 3
Show me a SQL query to find my top spending categories from the last three months using this database.
Prompt 4
Explain why this script treats deleted YNAB transactions as soft deletes instead of removing them.

Frequently asked questions

wtf is ynab-sqlite-export?

A zero dependency Python script that copies your entire YNAB budget into a local SQLite file, updating incrementally so you can query your finances with SQL.

What language is ynab-sqlite-export written in?

Mainly Python. The stack also includes Python, SQLite.

What license does ynab-sqlite-export use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is ynab-sqlite-export to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is ynab-sqlite-export for?

Mainly general.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.