python-fints
python-fints copied to clipboard
adjustments for bonds in regexp required
happy finding your lib. some segments are different if holdings do contain bonds, I added below to retrieve price and pieces which would be otherwise blank.
example :70E::HOLD//1NZD266,937 93B::AGGR//FAMT/2000,00
class MT535_Miniparser:
re_identification = re.compile(r"^:35B:ISIN\s(.*)\|(.*)\|(.*)$")
re_marketprice = re.compile(r"^:90B::MRKT\/\/ACTU\/([A-Z]{3})(\d*),{1}(\d*)$")
re_marketprice_b = re.compile(r"^:90A::MRKT\/\/PRCT\/(\d*),{1}(\d*)$")
re_pricedate = re.compile(r"^:98A::PRIC\/\/(\d*)$")
re_pieces = re.compile(r"^:93B::AGGR\/\/UNIT\/(\d*),(\d*)$")
re_pieces_b = re.compile(r"^:93B::AGGR\/\/FAMT\/(\d*),(\d*)$")
re_totalvalue = re.compile(r"^:19A::HOLD\/\/([A-Z]{3})(\d*),{1}(\d*)$")
re_acquisitionprice = re.compile(r"^:70E::HOLD\/\/\d*STK\|2(\d*?),{1}(\d*?)\+([A-Z]{3})$")
re_acquisitionprice_b = re.compile(r"^:70E::HOLD\/\/\d*([A-Z]{3})\|2(\d*?),{1}(\d*?)$")