Skip to content

Conversation

@johann-taberlet
Copy link

Summary

Adds a new transactions subcommand to export account transactions over a date range, using BoursoBank's CSV export endpoint (/budget/exporter-mouvements).

# CSV output (default)
bourso transactions -a <account_id> -f "01/01/2026" -t "31/01/2026"

# JSON output
bourso transactions -a <account_id> -f "01/01/2026" -t "31/01/2026" -o json

Changes

  • bourso_api::account: Add Transaction struct with all fields from BoursoBank CSV export
  • bourso_api::client::transaction: Add get_transactions() method on BoursoWebClient
    • Hits the /budget/exporter-mouvements endpoint with date range and account filter
    • Handles the 302 redirect to api.boursobank.com for file download (since the client uses Policy::none())
    • Parses BoursoBank CSV format (semicolon-separated, French number format with comma decimals and space thousands separators)
    • Returns empty Vec gracefully when an HTML error page is returned
  • CLI: Add transactions subcommand with --account, --from, --to, --output args
  • New dependency: csv crate for robust CSV parsing

Test plan

  • cargo build --release compiles without errors
  • cargo test -p bourso_api — 11 tests pass (3 new: test_parse_amount, test_extract_transactions, test_extract_transactions_empty_html)
  • Manual test: successfully exported 8 transactions from a live BoursoBank account with CSV output
  • Manual test: JSON output (-o json) works correctly

Add a new `transactions` subcommand to export account transactions
over a date range using BoursoBank's CSV export endpoint.

- Add `Transaction` struct to `bourso_api::account`
- Add `get_transactions()` method on `BoursoWebClient`
- Handle redirect to `api.boursobank.com` for file download
- Parse BoursoBank CSV (semicolon-separated, French number format)
- Support CSV (default) and JSON output formats
- Add unit tests for CSV parsing and amount conversion
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.

1 participant