Skip to content

Fix Revolut CSV format change (currency code prefix)#36

Merged
przemyslawbialon merged 2 commits intomainfrom
fix/revolut-csv-format-33
Apr 20, 2026
Merged

Fix Revolut CSV format change (currency code prefix)#36
przemyslawbialon merged 2 commits intomainfrom
fix/revolut-csv-format-33

Conversation

@przemyslawbialon
Copy link
Copy Markdown
Collaborator

Summary

Fixes #33 — Revolut changed Total Amount format from $1,003.01 to USD 1317.06.

Old parser did raw[1:] assuming a 1-char currency symbol, which produced SD 1317.06ValueError.

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 + amount
  • ValueError with full value if neither matches

Test plan

  • pytest tests/ — 55/55 pass
  • Manually verified all variants: $1,003.01, -$1,003.01, USD 1317.06, -USD 1317.06, €500.00, EUR 500.00

🤖 Generated with Claude Code

przemyslawbialon and others added 2 commits April 20, 2026 17:44
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>
@przemyslawbialon przemyslawbialon merged commit 9529fce into main Apr 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revolut: CSV has changed and script doesn't work anymore

1 participant