def get_list(self): table = self.parser.select(self.document.getroot(), "#tab-corps", 1) for tr in self.parser.select(table, "tr", "many"): tdname, tdid, tdagency, tdbalance = [td.text_content().strip() for td in self.parser.select(tr, "td", 4)] # it has empty rows - ignore those without the necessary info if all((tdname, tdid, tdbalance)): account = Account() account.label = to_unicode(tdname) account.id = to_unicode(tdid.replace(u"\xa0", "").replace(" ", "")) account._agency = to_unicode(tdagency) account._is_card = False account.balance = Decimal(Transaction.clean_amount(tdbalance)) account.currency = account.get_currency(tdbalance) yield account
def iter_accounts(self): for classeur in self.doc.get('donnees', {}).get('classeurs', {}): title = classeur['title'] for compte in classeur.get('comptes', []): a = Account() a.label = CleanText().filter(compte['libelle']) a._id = compte['id'] a.iban = compte['iban'].replace(' ', '') # id based on iban to match ids in database. a.id = a.iban[4:-2] if len(a.iban) == 27 else a.iban a.type = self.obj_type(a.label) a._agency = compte['agenceGestionnaire'] a._title = title yield a
def iter_accounts(self): for classeur in self.doc['donnees']['classeurs']: title = classeur['title'] for compte in classeur['comptes']: a = Account() a.label = compte['libelle'] a._id = compte['id'] a.iban = compte['iban'].replace(' ', '') # id based on iban to match ids in database. a.id = a.iban[4:-2] a.type = Account.TYPE_CHECKING a._agency = compte['agenceGestionnaire'] a._title = title yield a
def get_list(self): table = self.parser.select(self.document.getroot(), '#tab-corps', 1) for tr in self.parser.select(table, 'tr', 'many'): tdname, tdid, tdagency, tdbalance = [td.text_content().strip() for td in self.parser.select(tr, 'td', 4)] # it has empty rows - ignore those without the necessary info if all((tdname, tdid, tdbalance)): account = Account() account.label = to_unicode(tdname) account.id = to_unicode(tdid.replace(u'\xa0', '').replace(' ', '')) account._agency = to_unicode(tdagency) account._is_card = False account.balance = Decimal(Transaction.clean_amount(tdbalance)) account.currency = account.get_currency(tdbalance) yield account
def get_list(self): table = self.parser.select(self.document.getroot(), '#tab-corps', 1) for tr in self.parser.select(table, 'tr', 'many'): tdname, tdid, tdagency, tdbalance = [td.text_content().strip() for td in self.parser.select(tr, 'td', 4)] # it has empty rows - ignore those without the necessary info if all((tdname, tdid, tdbalance)): account = Account() account.label = to_unicode(tdname) account.type = self.TYPES.get(account.label, Account.TYPE_UNKNOWN) account.id = to_unicode(tdid.replace(u'\xa0', '').replace(' ', '')) account._agency = to_unicode(tdagency) account._is_card = False account.balance = Decimal(Transaction.clean_amount(tdbalance)) account.currency = account.get_currency(tdbalance) yield account
def iter_accounts(self): for classeur in self.doc.get('donnees', {}).get('classeurs', {}): title = classeur['title'] for compte in classeur.get('comptes', []): a = Account() a.label = CleanText().filter(compte['libelle']) a._id = compte['id'] a.type = self.obj_type(a.label) a.number = compte['iban'].replace(' ', '') # for some account that don't have Iban the account number is store under this variable in the Json if not is_iban_valid(a.number): a.iban = NotAvailable else: a.iban = a.number # id based on iban to match ids in database. a.id = a.number[4:-2] if len(a.number) == 27 else a.number a._agency = compte['agenceGestionnaire'] a._title = title yield a
def iter_accounts(self): for classeur in self.doc.get('donnees', {}).get('classeurs', {}): title = classeur['title'] for compte in classeur.get('comptes', []): a = Account() a.label = CleanText().filter(compte['libelle']) a._id = compte['id'] a.type = self.obj_type(a.label) a.number = compte['iban'].replace(' ', '') # for some account that don't have Iban the account number is store under this variable in the Json if not is_iban_valid(a.number): a.iban = NotAvailable else: a.iban = a.number # id based on iban to match ids in database. a.id = a.number[4:-2] if len(a.number) == 27 else a.number a._agency = compte['agenceGestionnaire'] a._title = title yield a