kedder/ofxstatement

Support for generating multiple StatementLines per input line

iandees opened this issue · 4 comments

I'm interested in implementing a plugin for Stripe, but each CSV line in the "balance history" export from Stripe has the amount received as well as the Stripe fee. I'd like to return one StatementLine for the amount and a separate one for the fee. Unfortunately, it looks like the plugin API only allows for one StatementLine parsed per input line.

Is there a way around this? Any ideas for implementation change? I'm happy to submit a PR.

@iandees, the basic interface for parser is very simple: you only have to implement __init__(fin) and parse() function, i.e. you don't have to inherit from StatementParser class or use its helpers (targeted mainly to csv files). parse() function has to return Statement object and is free to do whatever it takes to parse fin file, passed to its constructor.

@iandees - once done, would you share your code? I have a similar issue for two plugins and am not as skilled to easily do so myself.

Closing this, as this mode of operation is already supported, Overriding parse() allows to yield as many lines as needed.