Fix Revolut CSV format change (currency code prefix)#36
Merged
przemyslawbialon merged 2 commits intomainfrom Apr 20, 2026
Merged
Fix Revolut CSV format change (currency code prefix)#36przemyslawbialon merged 2 commits intomainfrom
przemyslawbialon merged 2 commits intomainfrom
Conversation
Revolut changed Total Amount from '$1,003.01' to 'USD 1317.06'.
Old parser did raw[1:] assuming 1-char currency symbol, which broke
on 3-char codes ('SD 1317.06' → ValueError).
Now uses explicit regex matching for both formats:
- Currency code: 'USD 1317.06', 'EUR 500.00'
- Currency symbol: '$1,003.01', '€500.00'
- ValueError with full value if neither matches
Fixes #33
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add cross-validation between currency parsed from Total Amount and the Currency CSV column. Add unit tests for _fiat_value covering both old ($500) and new (USD 500) formats, negatives, commas, mismatch errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #33 — Revolut changed
Total Amountformat from$1,003.01toUSD 1317.06.Old parser did
raw[1:]assuming a 1-char currency symbol, which producedSD 1317.06→ValueError.Now uses explicit regex matching for both formats:
USD 1317.06,EUR 500.00— currency code + space + amount$1,003.01,€500.00— currency symbol + amountValueErrorwith full value if neither matchesTest plan
pytest tests/— 55/55 pass$1,003.01,-$1,003.01,USD 1317.06,-USD 1317.06,€500.00,EUR 500.00🤖 Generated with Claude Code