A powerful CLI tool for converting bank export files to YNAB-compatible CSV format with interactive preset management
Project description
YNAB Import Tool
A command-line tool for converting bank export files (CSV, Excel) to YNAB-compatible CSV format.
What it does
- Converts bank transaction files to YNAB's required CSV format
- Supports CSV and Excel files (.csv, .xlsx, .xls)
- Interactive terminal interface for file conversion
- Saves conversion settings as reusable presets
- Preview data before conversion
- Parses common locale-specific amount formats such as
1,234.56,1.234,56, and accounting negatives - Can auto-detect header rows for exports where the number of leading rows changes between files
- Shows richer conversion errors with stage-specific details and relevant data excerpts
Installation
pip install ynab-converter
Quick Start
-
Run the tool:
ynab-converter
-
Create a preset using a sample file from your bank
-
Convert your bank files using the preset
-
Import the generated CSV into YNAB
How it works
Creating a preset
When you first run the tool, you'll create a preset for your bank's file format:
- Select a sample file - Choose a transaction file from your bank
- Preview the data - See how your file looks
- Choose header handling - Use a fixed number of skipped rows or let the preset auto-detect the header row each time
- Clean up data - Remove footer rows and unwanted summary rows if needed
- Map columns - Tell the tool which columns contain:
- Date
- Payee/Description
- Amount (or separate Inflow/Outflow columns)
- Memo (optional)
Converting files
Once you have a preset:
- Select "Convert File"
- Choose your transaction file
- The tool reads, cleans, validates, and converts your file
- If conversion fails, the CLI shows the failing stage, what was expected, and a compact excerpt of relevant data
- The tool generates a YNAB-ready CSV file
Smarter Parsing and Detection
Amount parsing
The converter now normalizes common amount formats automatically, including:
1,234.561.234,561 234,56- values with currency symbols
- negative values written with
-or parentheses, for example($123.45)
This applies both to:
- one signed amount column mapped to both
InflowandOutflow - separate
InflowandOutflowcolumns stored as strings
Header auto-detection
For exports where the number of rows before the table changes between files, presets can now use an auto-detect header mode:
- the converter looks for the row that best matches the mapped source column names
- if detection succeeds, that row becomes the header row for conversion
- if detection cannot confidently identify the header, the preset falls back to its saved header skip count and warns you
Richer diagnostics
When a preset fails during preview or conversion, the CLI now tries to show:
- which stage failed (
read,clean,convert, orwrite) - what the converter expected
- the actual problem it saw
- the relevant mapped columns
- a small data excerpt to help you spot formatting or header issues quickly
File Support
| Format | Extensions | Notes |
|---|---|---|
| CSV | .csv |
Auto-detects separators |
| Excel | .xlsx, .xls |
Reads first sheet |
Platform Compatibility
Supported platforms:
- macOS (tested on macOS 15)
- Linux (tested on Ubuntu and other distributions)
Not supported:
- Windows (not tested, may have compatibility issues)
Requirements
- Python 3.12+
Configuration
Settings and presets are saved in:
- Config:
~/.config/ynab-converter/config.toml - Presets:
~/.config/ynab-converter/presets/presets.json - Output:
~/Downloads/ynab-exports/(default)
Presets now also store how headers should be handled:
- fixed skipped-row mode
- auto-detect mode with saved fallback skip count
Development
git clone https://github.com/pavelapekhtin/ynab-import.git
cd ynab-import
uv sync --dev
Run tests:
uv run pytest
License
MIT License - see LICENSE file for details.
Support
- 🐛 Issues: GitHub Issues
- 📖 Documentation: This README
Note: This tool is not affiliated with YNAB (You Need A Budget). It's an independent utility to help convert bank files to YNAB's CSV format.
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
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 ynab_converter-0.8.0.tar.gz.
File metadata
- Download URL: ynab_converter-0.8.0.tar.gz
- Upload date:
- Size: 33.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
938a76db2ae6c67bc460187665f414e8b0228a3156790f842e59590b3f20fec2
|
|
| MD5 |
54e8b6830b10f908935c52a16c896e7c
|
|
| BLAKE2b-256 |
dd7af0dba6c2391c6107805dbe6a86ccac44b9ffe9d22cc0f0f13dd20a3fd28a
|
File details
Details for the file ynab_converter-0.8.0-py3-none-any.whl.
File metadata
- Download URL: ynab_converter-0.8.0-py3-none-any.whl
- Upload date:
- Size: 26.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99e150e82a3d4870922f11f2e53be5b4448d7ea229520aa496c050c417e98568
|
|
| MD5 |
d1157fe49b55acceab54d5e8d0b8b273
|
|
| BLAKE2b-256 |
56cc3d215ba331d424e9d03f9144193e16f79bdb63026409357b06c499e12613
|