Skip to content
Permalink
Browse files

Add a basic example of rule parsing for the output of csb2format.

csb2format deals with the CSB43/AEB43 format, which all banks operating in
Spain must support.
Having these example rules enables easens bootstraping for users with a
Spanish bank account.
  • Loading branch information
evilham authored and simonmichael committed Dec 5, 2019
1 parent 1aac7e9 commit 60b26b8e4b9616d197db3e7aec206fee63ca7afa
Showing with 18 additions and 0 deletions.
  1. +3 −0 examples/csv/csb43.csv
  2. +15 −0 examples/csv/csb43.csv.rules
@@ -0,0 +1,3 @@
bank_code,branch_code,account_key,account_number,information_mode,short_name,currency,initial_date,final_date,initial_balance,final_balance,income,expenses,income_entries,expenses_entries,branch_code,document_number,shared_item,own_item,item1,item2,reference1,reference2,transaction_date,value_date,amount,original_currency,original_amount
1234,5678,90,1234567890,3,N.SURNAME,EUR,2019-11-01,2019-11-30,000.00,1000.00,1500.00,500.0,1,1,1234,567890123,12,000,MY_INCOME_LINE,,456789012345,,2019-11-02,2019-11-02,1500.00,,
1234,5678,90,1234567890,3,N.SURNAME,EUR,2019-11-01,2019-11-30,000.00,1000.00,1500.00,500.0,1,1,1234,567890123,12,000,MY_EXPENSE_LINE,,456789012345,,2019-11-10,2019-11-10,-500.00,,
@@ -0,0 +1,15 @@
# csb43.csv.rules
# Rules for csb2format -f csv "${CSV_FILE}" -
# Using https://pypi.org/project/csb43/

# Skip header
skip 1

# Change to your taste
account1 assets:bank:csb43

# These appear to be the useful columns for hledger
fields _,_,_,_,_,_,currency,_,_,_,_,_,_,_,_,_,_,_,_,item1,item2,reference1,reference2,date,_,amount,_,_

# Merge items for the description
description %item1 %item2 %reference1 %reference2

0 comments on commit 60b26b8

Please sign in to comment.
You can’t perform that action at this time.