weboob.capabilities.bank

exception weboob.capabilities.bank.AccountNotFound(msg='Account not found')

Bases: weboob.capabilities.base.UserError

Raised when an account is not found.

exception weboob.capabilities.bank.TransferError(description=None, message=None)

Bases: weboob.capabilities.base.UserError

A transfer has failed.

Parameters:message – error message from the bank, if any
code = 'transferError'
exception weboob.capabilities.bank.TransferStep(transfer, *values)

Bases: weboob.exceptions.BrowserQuestion

class weboob.capabilities.bank.Recipient(id='0', url=None)

Bases: weboob.capabilities.bank.BaseAccount

Recipient of a transfer.
Variables:
  • enabled_at – (date, datetime) Date of availability
  • category – (unicode) Recipient category
class weboob.capabilities.bank.Account(id='0', url=None)

Bases: weboob.capabilities.bank.BaseAccount

Bank account.
Variables:
  • type – (int, long) Type of account (default: 0)
  • balance – (Decimal) Balance on this bank account
  • coming – (Decimal) Sum of coming movements
  • paydate – (date, datetime) For credit cards. When next payment is due.
  • paymin – (Decimal) For credit cards. Minimal payment due.
  • cardlimit – (Decimal) For credit cards. Credit limit.
  • number – (unicode) Shown by the bank to identify your account ie XXXXX7489
  • valuation_diff – (Decimal) +/- values total
  • parent – (BaseAccount) Parent account
  • opening_date – (date, datetime) Date when the account contract was created on the bank
TYPE_ARTICLE_83 = 11

Article 83

TYPE_CAPITALISATION = 14

Life Insurance capitalisation

TYPE_CARD = 7

Card account

TYPE_CHECKING = 1

Transaction, everyday transactions

TYPE_DEPOSIT = 3

Term of Fixed Deposit, has time/amount constraints

TYPE_JOINT = 6

Joint account

TYPE_LIFE_INSURANCE = 8

Life insurances

TYPE_LOAN = 4

Loan account

TYPE_MADELIN = 16

Complementary retirement savings

TYPE_MARKET = 5

Stock market or other variable investments

TYPE_PEA = 13

Share savings

TYPE_PEE = 9

Employee savings PEE

TYPE_PERCO = 10

Employee savings PERCO

TYPE_PERP = 15

Retirement savings

TYPE_RSP = 12

Employee savings RSP

TYPE_SAVINGS = 2

Savings/Deposit, can be used for every banking

TYPE_UNKNOWN = 0
class weboob.capabilities.bank.Transaction(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.base.BaseObject

Bank transaction.
Variables:
  • date – (date, datetime) Debit date on the bank statement
  • rdate – (date, datetime) Real date, when the payment has been made; usually extracted from the label or from credit card info
  • vdate – (date, datetime) Value date, or accounting date; usually for professional accounts
  • type – (int, long) Type of transaction, use TYPE_* constants (default: 0)
  • raw – (unicode) Raw label of the transaction
  • category – (unicode) Category of the transaction
  • label – (unicode) Pretty label
  • amount – (Decimal) Amount of the transaction
  • card – (unicode) Card number (if any)
  • commission – (Decimal) Commission part on the transaction (in account currency)
  • original_amount – (Decimal) Original amount (in another currency)
  • original_currency – (unicode) Currency of the original amount
  • country – (unicode) Country of transaction
  • investments – (list) List of investments related to the transaction (default: [])
TYPE_BANK = 9
TYPE_CARD = 7
TYPE_CARD_SUMMARY = 11
TYPE_CASH_DEPOSIT = 10
TYPE_CHECK = 3
TYPE_DEFERRED_CARD = 12
TYPE_DEPOSIT = 4
TYPE_LOAN_PAYMENT = 8
TYPE_ORDER = 2
TYPE_PAYBACK = 5
TYPE_TRANSFER = 1
TYPE_UNKNOWN = 0
TYPE_WITHDRAWAL = 6
unique_id(seen=None, account_id=None)

Get an unique ID for the transaction based on date, amount and raw.

Parameters:
  • seen (dict) – if given, the method uses this dictionary as a cache to prevent several transactions with the same values to have the same unique ID.
  • account_id (str) – if given, add the account ID in data used to create the unique ID. Can be useful if you want your ID to be unique across several accounts.
Returns:

an unique ID encoded in 8 length hexadecimal string (for example 'a64e1bc9')

Return type:

str

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

Bases: weboob.capabilities.base.BaseObject

Investment in a financial market.
Variables:
  • label – (unicode) Label of stocks
  • code – (unicode) Identifier of the stock
  • code_type – (unicode) Type of stock code (ISIN or AMF)
  • description – (unicode) Short description of the stock
  • quantity – (Decimal) Quantity of stocks
  • unitprice – (Decimal) Buy price of one stock
  • unitvalue – (Decimal) Current value of one stock
  • valuation – (Decimal) Total current valuation of the Investment
  • vdate – (date, datetime) Value date of the valuation amount
  • diff – (Decimal) Difference between the buy cost and the current valuation
  • diff_percent – (Decimal) Difference in percentage between the buy cost and the current valuation
  • portfolio_share – (Decimal) Percentage of the current amount relative to the total
  • original_currency – (unicode) Currency of the original amount
  • original_valuation – (Decimal) Original valuation (in another currency)
  • original_unitvalue – (Decimal) Original unitvalue (in another currency)
  • original_unitprice – (Decimal) Original unitprice (in another currency)
  • original_diff – (Decimal) Original diff (in another currency)
CODE_TYPE_AMF = u'AMF'
CODE_TYPE_ISIN = u'ISIN'
class weboob.capabilities.bank.Transfer(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.base.BaseObject, weboob.capabilities.base.Currency

Transfer from an account to a recipient.
Variables:
  • amount – (Decimal) Amount to transfer
  • currency – (unicode) Currency (default: None)
  • fees – (Decimal) Fees (default: None)
  • exec_date – (date, datetime) Date of transfer
  • account_id – (unicode) ID of origin account
  • account_iban – (unicode) International Bank Account Number
  • account_label – (unicode) Label of origin account
  • account_balance – (Decimal) Balance of origin account before transfer
  • recipient_id – (unicode) ID of recipient account
  • recipient_iban – (unicode) International Bank Account Number
  • recipient_label – (unicode) Label of recipient account
  • label – (unicode) Reason
class weboob.capabilities.bank.CapBank

Bases: weboob.capabilities.collection.CapCollection

Capability of bank websites to see accounts and transactions.

get_account(id)

Get an account from its ID.

Parameters:id (str) – ID of the account
Return type:Account
Raises:AccountNotFound
iter_accounts()

Iter accounts.

Return type:iter[Account]
iter_coming(account)

Iter coming transactions on a specific account.

Parameters:account (Account) – account to get coming transactions
Return type:iter[Transaction]
Raises:AccountNotFound
iter_history(account)

Iter history of transactions on a specific account.

Parameters:account (Account) – account to get history
Return type:iter[Transaction]
Raises:AccountNotFound
iter_resources(objs, split_path)

Iter resources.

Default implementation of this method is to return on top-level all accounts (by calling iter_accounts()).

Parameters:
  • objs (tuple[BaseObject]) – type of objects to get
  • split_path (list) – path to discover
Return type:

iter[BaseObject]

class weboob.capabilities.bank.CapBankTransfer

Bases: weboob.capabilities.bank.CapBank

execute_transfer(transfer, **params)

Execute a transfer.

:param Transfer :rtype: Transfer :raises: TransferError

init_transfer(transfer, **params)

Initiate a transfer.

:param Transfer :rtype: Transfer :raises: TransferError

iter_transfer_recipients(account)

Iter recipients availables for a transfer from a specific account.

Parameters:account (Account) – account which initiate the transfer
Return type:iter[Recipient]
Raises:AccountNotFound
transfer(transfer, **params)

Do a transfer from an account to a recipient.

:param Transfer :rtype: Transfer :raises: TransferError

transfer_check_label(old, new)
class weboob.capabilities.bank.CapBankTransferAddRecipient

Bases: weboob.capabilities.bank.CapBankTransfer

add_recipient(recipient, **params)

Add a recipient to the connection.

Parameters:
  • iban (str) – iban of the new recipient.
  • label (:class`str`) – label of the new recipient.
Raises:

BrowserQuestion

Raises:

AddRecipientError

Return type:

Recipient

new_recipient(recipient, **params)
exception weboob.capabilities.bank.RecipientNotFound(msg='Recipient not found')

Bases: weboob.capabilities.base.UserError

Raised when a recipient is not found.

exception weboob.capabilities.bank.AddRecipientError(description=None, message=None)

Bases: weboob.capabilities.base.UserError

Failed trying to add a recipient.

Parameters:message – error message from the bank, if any
code = 'AddRecipientError'
exception weboob.capabilities.bank.AddRecipientStep(recipient, *values)

Bases: weboob.exceptions.BrowserQuestion

class weboob.capabilities.bank.BaseAccount(id='0', url=None)

Bases: weboob.capabilities.base.BaseObject, weboob.capabilities.base.Currency

Generic class aiming to be parent of Recipient and Account.
Variables:
  • label – (unicode) Pretty label
  • currency – (unicode) Currency (default: None)
  • iban – (unicode) International Bank Account Number
  • bank_name – (unicode) Bank Name
ban

Bank Account Number part of IBAN

currency_text