Plugin for ofxstatement to convert CSV statements exported from Lloyds Bank (UK) into OFX format for import into accounting software such as Odoo, GnuCash, and others.
- Payee extraction
- Parses Lloyds transaction descriptions to produce a clean payee name in the
OFX
<NAME>field. Downstream importers use this as the primary transaction label for display and auto-reconciliation. - Transaction type preservation
- Prefixes the OFX
<MEMO>field with the original Lloyds transaction type code (DD, FPI, FPO, DEB, BGC etc.), preserving detail that is lost in the standard OFX TRNTYPE mapping. - Structured memo
- Splits the description into payee and remainder, so importers that display
NAME : MEMOshow useful detail rather than duplication. - Balance tracking
- Calculates opening and closing balances from the reverse-chronological CSV, included in the OFX output for statement validation.
- Card purchases
MERCHANT CD nnnn [ddMMMYY]extracts the merchant name.- FX purchases
MERCHANT [ref] [CURRENCY] amount VISAXR rate CD nnnnextracts the merchant, with FX details in the memo.- FX fees
NON-GBP TRANS FEE n.nn% CD nnnnnormalised toNon-GBP Transaction Fee.- Faster payments (FPI/FPO/BGC)
PAYEE reference sortcode ddMMMYY HH:MMextracts the payer or payee name.- Direct debits and standing orders (DD/SO)
PAYEE mandate-referenceextracts the payee name.- Service charges (PAY)
SERVICE CHARGES REF : numberextracts the charge description.
Unrecognised formats fall back to the full description as payee with the transaction type code as memo.
pip install ofxstatement-lloydsOr with pipx:
pipx inject ofxstatement ofxstatement-lloydsEdit the ofxstatement configuration:
ofxstatement edit-configAdd a section for your Lloyds account:
[lloyds]
plugin = lloyds
currency = GBPExport a CSV statement from Lloyds online banking, then convert:
ofxstatement convert -t lloyds statement.csv statement.ofxThe CSV is expected in the format provided by Lloyds online banking with columns: date, type, sort code, account number, description, debit, credit, balance.
The payee and memo split is designed to work with Odoo's reconciliation models
and the OCA account_statement_completion_label_simple module.
The Label field in Odoo matches against the OFX <NAME> (clean payee).
The Note field matches against <MEMO> (prefixed with the Lloyds
transaction type code).
Example reconciliation model rules:
| Label Contains | Note Contains | Action |
|---|---|---|
Non-GBP |
Counterpart: bank charges expense account | |
DIRECT LINE |
DD |
Partner: Direct Line Insurance |
FPI |
Filter: incoming faster payments only | |
HMRC |
FPO |
Partner: HMRC |