weboob.tools.capabilities.bank.transactions

class weboob.tools.capabilities.bank.transactions.FrenchTransaction(id='', *args, **kwargs)

Bases: weboob.capabilities.bank.Transaction

Transaction with some helpers for french bank websites.

class Amount(credit, debit=None, replace_dots=True)

Bases: weboob.browser.filters.base.Filter

class FrenchTransaction.Currency(selector=None, symbols='', replace=[], children=True, newlines=True, normalize='NFC', **kwargs)

Bases: weboob.browser.filters.standard.CleanText

Parameters:
  • symbols (list) – list of strings to remove from text
  • replace (list[tuple[str, str]]) – optional pairs of text replacements to perform
  • children (bool) – whether to get text from children elements of the select elements
  • newlines (bool) – if True, newlines will be converted to space too
  • normalize (str or None) – Unicode normalization to perform
filter(text)
class FrenchTransaction.Date(selector=None, symbols='', replace=[], children=True, newlines=True, normalize='NFC', **kwargs)

Bases: weboob.browser.filters.standard.CleanText

Parameters:
  • symbols (list) – list of strings to remove from text
  • replace (list[tuple[str, str]]) – optional pairs of text replacements to perform
  • children (bool) – whether to get text from children elements of the select elements
  • newlines (bool) – if True, newlines will be converted to space too
  • normalize (str or None) – Unicode normalization to perform
filter(date)
FrenchTransaction.PATTERNS = []
classmethod FrenchTransaction.Raw(klass, *args, **kwargs)
FrenchTransaction.TransactionElement

alias of _TransactionElement

FrenchTransaction.TransactionsElement

alias of _TransactionsElement

classmethod FrenchTransaction.clean_amount(klass, text)

Clean a string containing an amount.

FrenchTransaction.parse(date, raw, vdate=None)

Parse date and raw strings to create datetime.date objects, determine the type of transaction, and create a simplified label

When calling this method, you should have defined patterns (in the PATTERN class attribute) with a list containing tuples of regexp and the associated type, for example:

PATTERNS = [(re.compile(r'^VIR(EMENT)? (?P<text>.*)'), FrenchTransaction.TYPE_TRANSFER),
            (re.compile(r'^PRLV (?P<text>.*)'),        FrenchTransaction.TYPE_ORDER),
            (re.compile(r'^(?P<text>.*) CARTE \d+ PAIEMENT CB (?P<dd>\d{2})(?P<mm>\d{2}) ?(.*)$'),
                                                       FrenchTransaction.TYPE_CARD)
           ]

In regexps, you can define this patterns:

  • text: part of label to store in simplified label
  • category: part of label representing the category
  • yy, mm, dd, HH, MM: date and time parts
FrenchTransaction.parse_date(date)
FrenchTransaction.set_amount(credit='', debit='')

Set an amount value from a string.

Can take two strings if there are both credit and debit columns.

class weboob.tools.capabilities.bank.transactions.AmericanTransaction(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.bank.Transaction

Transaction with some helpers for american bank websites.

classmethod clean_amount(klass, text)

Clean a string containing an amount.

classmethod decimal_amount(klass, text)

Convert a string containing an amount to Decimal.