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.
@iandees - look at a possible solution here (line 138...)
https://github.com/milankni/ofxstatement-airbankcz/blob/b22d2db87f6cf4ba37adc15f2d6d6dd94f901b0e/src/ofxstatement/plugins/airbankcz.py
Closing this, as this mode of operation is already supported, Overriding parse()
allows to yield as many lines as needed.