weboob.capabilities.bank

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.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)
  • bank_name – (unicode) Bank Name
ban

Bank Account Number part of IBAN

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

Bases: weboob.capabilities.bank.BaseAccount

Bank account.
Variables:
  • type – (int) Type of account (default: 0)
  • owner_type – (unicode) Usage of account
  • balance – (Decimal) Balance on this bank account
  • coming – (Decimal) Sum of coming movements
  • iban – (unicode) International Bank Account Number
  • 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
  • valuation_diff_ratio – (Decimal) +/- values ratio
  • parent – (BaseAccount) Parent account
  • opening_date – (date, datetime) Date when the account contract was created on the bank
TYPE_ARTICLE_83 = 11
TYPE_CAPITALISATION = 14
TYPE_CARD = 7
TYPE_CHECKING = 1
TYPE_CONSUMER_CREDIT = 18
TYPE_DEPOSIT = 3
TYPE_JOINT = 6
TYPE_LIFE_INSURANCE = 8
TYPE_LOAN = 4
TYPE_MADELIN = 16
TYPE_MARKET = 5
TYPE_MORTGAGE = 17
TYPE_PEA = 13
TYPE_PEE = 9
TYPE_PERCO = 10
TYPE_PERP = 15
TYPE_REVOLVING_CREDIT = 19
TYPE_RSP = 12
TYPE_SAVINGS = 2
TYPE_UNKNOWN = 0
valuation_diff_percent
class weboob.capabilities.bank.Loan(id='0', url=None)

Bases: weboob.capabilities.bank.Account

Account type dedicated to loans and credits.
Variables:
  • name – (unicode) Person name
  • account_label – (unicode) Label of the debited account
  • insurance_label – (unicode) Label of the insurance
  • total_amount – (Decimal) Total amount loaned
  • available_amount – (Decimal) Amount available
  • used_amount – (Decimal) Amount already used
  • subscription_date – (date, datetime) Date of subscription of the loan
  • maturity_date – (date, datetime) Estimated end date of the loan
  • duration – (int, long) Duration of the loan given in months
  • rate – (Decimal) Monthly rate of the loan
  • nb_payments_left – (int, long) Number of payments still due
  • nb_payments_done – (int, long) Number of payments already done
  • nb_payments_total – (int, long) Number total of payments
  • last_payment_amount – (Decimal) Amount of the last payment done
  • last_payment_date – (date, datetime) Date of the last payment done
  • next_payment_amount – (Decimal) Amount of next payment
  • next_payment_date – (date, datetime) Date of the next payment
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) 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

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

Bases: weboob.capabilities.base.UserError

Raised when an account is not found.

class weboob.capabilities.bank.AccountType

Bases: weboob.capabilities.base.Enum

ARTICLE_83 = 11

Article 83

CAPITALISATION = 14

Life Insurance capitalisation

CARD = 7

Card account

CHECKING = 1

Transaction, everyday transactions

CONSUMER_CREDIT = 18

Consumer credit

DEPOSIT = 3

Term of Fixed Deposit, has time/amount constraints

JOINT = 6

Joint account

LIFE_INSURANCE = 8

Life insurances

LOAN = 4

Loan account

MADELIN = 16

Complementary retirement savings

MARKET = 5

Stock market or other variable investments

MORTGAGE = 17

Mortgage

PEA = 13

Share savings

PEE = 9

Employee savings PEE

PERCO = 10

Employee savings PERCO

PERP = 15

Retirement savings

REVOLVING_CREDIT = 19

Revolving credit

RSP = 12

Employee savings RSP

SAVINGS = 2

Savings/Deposit, can be used for every banking

UNKNOWN = 0
class weboob.capabilities.bank.CapBankWealth

Bases: weboob.capabilities.bank.CapBank

Capability of bank websites to see investment.

iter_investment(account)

Iter investment of a market account

Parameters:account (Account) – account to get investments
Return type:iter[Investment]
Raises:AccountNotFound
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_ratio – (Decimal) Difference in ratio (1 meaning 100%) between the buy cost and the current valuation
  • portfolio_share – (Decimal) Ratio (1 meaning 100%) 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'
diff_percent
class weboob.capabilities.bank.CapBankPockets

Bases: weboob.capabilities.bank.CapBankWealth

Capability of bank websites to see pockets.

iter_pocket(account)

Iter pocket

Parameters:account (Account) – account to get pockets
Return type:iter[Pocket]
Raises:AccountNotFound
class weboob.capabilities.bank.Pocket(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.base.BaseObject

Pocket
Variables:
  • label – (unicode) Label of pocket
  • amount – (Decimal) Amount of the pocket
  • quantity – (Decimal) Quantity of stocks
  • availability_date – (date, datetime) Availability date of the pocket
  • condition – (int) Withdrawal condition of the pocket (default: 0)
  • investment – (Investment) Reference to the investment of the pocket
CONDITION_AVAILABLE = 2
CONDITION_BREACH_EMPLOYMENT_CONTRACT = 10
CONDITION_BUSINESS_CREATION = 9
CONDITION_DATE = 1
CONDITION_DEATH = 5
CONDITION_DISABILITY = 8
CONDITION_DIVORCE = 7
CONDITION_EXPIRATION_UNEMPLOYMENT = 13
CONDITION_INDEBTEDNESS = 6
CONDITION_PURCHASE_APARTMENT = 14
CONDITION_RETIREMENT = 3
CONDITION_THIRD_CHILD = 12
CONDITION_UNKNOWN = 0
CONDITION_UNLOCKING_EXCEPTIONAL = 11
CONDITION_WEDDING = 4
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.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.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
  • iban – (unicode) International Bank Account Number
  • origin_account_id – (unicode) Account id which recipient belong to
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.TransferBankError(description=None, message=None)

Bases: weboob.capabilities.bank.TransferError

The transfer was rejected by the bank with a message.

Parameters:message – error message from the bank, if any
code = 'bankMessage'
exception weboob.capabilities.bank.TransferInvalidAmount(description=None, message=None)

Bases: weboob.capabilities.bank.TransferError

This amount is not allowed.

Parameters:message – error message from the bank, if any
code = 'invalidAmount'
exception weboob.capabilities.bank.TransferInsufficientFunds(description=None, message=None)

Bases: weboob.capabilities.bank.TransferInvalidAmount

Not enough funds on emitter account.

Parameters:message – error message from the bank, if any
code = 'insufficientFunds'
exception weboob.capabilities.bank.TransferInvalidCurrency(description=None, message=None)

Bases: weboob.capabilities.bank.TransferInvalidAmount

The transfer currency is invalid.

Parameters:message – error message from the bank, if any
code = 'invalidCurrency'
exception weboob.capabilities.bank.TransferInvalidLabel(description=None, message=None)

Bases: weboob.capabilities.bank.TransferError

The transfer label is invalid.

Parameters:message – error message from the bank, if any
code = 'invalidLabel'
exception weboob.capabilities.bank.TransferInvalidEmitter(description=None, message=None)

Bases: weboob.capabilities.bank.TransferError

The emitter account cannot be used for transfers.

Parameters:message – error message from the bank, if any
code = 'invalidEmitter'
exception weboob.capabilities.bank.TransferInvalidRecipient(description=None, message=None)

Bases: weboob.capabilities.bank.TransferError

The emitter cannot transfer to this recipient.

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

Bases: weboob.exceptions.BrowserQuestion

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.AddRecipientBankError(description=None, message=None)

Bases: weboob.capabilities.bank.AddRecipientError

The new recipient was rejected by the bank with a message.

Parameters:message – error message from the bank, if any
code = 'bankMessage'
exception weboob.capabilities.bank.AddRecipientTimeout(description=None, message=None)

Bases: weboob.capabilities.bank.AddRecipientError

Add new recipient request has timeout

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

Bases: weboob.exceptions.BrowserQuestion

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

Bases: weboob.capabilities.bank.AddRecipientError

Parameters:message – error message from the bank, if any
code = 'invalidIban'
exception weboob.capabilities.bank.RecipientInvalidLabel(description=None, message=None)

Bases: weboob.capabilities.bank.AddRecipientError

Parameters:message – error message from the bank, if any
code = 'invalidLabel'
class weboob.capabilities.bank.Rate(id=u'', url=NotLoaded, backend=None)

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

Currency exchange rate.
Variables:
  • currency_from – (unicode) The currency to which exchange rates are relative to. When converting 1 EUR to X HUF, currency_fom is EUR.) (default: None)
  • currency_to – (unicode) The currency is converted to. When converting 1 EUR to X HUF, currency_to is HUF.) (default: None)
  • value – (Decimal) Exchange rate
  • datetime – (date, datetime) Collection date and time
class weboob.capabilities.bank.CapCurrencyRate

Bases: weboob.capabilities.bank.CapBank

Capability of bank websites to get currency exchange rates.

get_rate(currency_from, currency_to)

Get exchange rate.

Parameters:
  • currency_from (Currency) – currency to which exchange rate is relative to
  • currency_to (:class`Currency`) – currency is converted to
Return type:

Rate

iter_currencies()

Iter available currencies.

Return type:iter[Currency]