woob.capabilities.bank.base
¶
- class CapBank[source]¶
Bases:
CapCollection
,CapCredentialsCheck
Capability of bank websites to see accounts and transactions.
- check_credentials()[source]¶
Check that the given credentials are correct by trying to login.
The default implementation of this method check if the class using this capability has a browser, execute its do_login if it has one and then see if no error pertaining to the creds is raised. If any other unexpected error occurs, we don’t know whether the creds are correct or not.
- Return type:
- iter_resources(objs, split_path)[source]¶
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 getsplit_path (
list
) – path to discover
- Return type:
iter[
BaseObject
]
- get_account(id)[source]¶
Get an account from its ID.
- Parameters:
id (
str
) – ID of the account- Return type:
- Raises:
- iter_history(account)[source]¶
Iter history of transactions of a specific account.
- Parameters:
account (
Account
) – account to get history- Return type:
iter[
Transaction
]- Raises:
- iter_coming(account)[source]¶
Iter coming transactions of a specific account.
- Parameters:
account (
Account
) – account to get coming transactions- Return type:
iter[
Transaction
]- Raises:
- iter_transactions(account, *, with_history=True, with_coming=True)[source]¶
Iter all transactions (history and coming) of a specific account.
- Parameters:
- Return type:
iter[
Transaction
]- Raises:
- class BaseAccount(id='0', url=NotLoaded)[source]¶
Bases:
BaseObject
,Currency
Generic class aiming to be parent of
Recipient
andAccount
.- Variables:
- class Account(id='0', url=NotLoaded)[source]¶
Bases:
BaseAccount
Bank account.
- Variables:
url – (
str
) urllabel – (
str
) Pretty labelcurrency – (
str
) Currency (default: None)bank_name – (
str
) Bank Nametype – (
int
) Type of account (default: 0)owner_type – (
str
) Usage of accountbalance – (
Decimal
) Balance on this bank accountcoming – (
Decimal
) Sum of coming movementsiban – (
str
) International Bank Account Numberownership – (
str
) Relationship between the credentials owner (PSU) and the accountpaydate – (
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 – (
str
) Shown by the bank to identify your account ie XXXXX7489valuation_diff – (
Decimal
) +/- values totalvaluation_diff_ratio – (
Decimal
) +/- values ratiomanagement_type – (
str
) Management type of account (default: None)company_name – (
str
) Name of the company of the stock - only for employee savingsparent – (
BaseAccount
) Parent accountopening_date – (
date
,datetime
) Date when the account contract was created on the bankall_balances – (
list
) List of balances (default: [])party – (
AccountParty
) Party associated to the account (default: None)
- TYPE_UNKNOWN = 0¶
- TYPE_CHECKING = 1¶
- TYPE_SAVINGS = 2¶
- TYPE_DEPOSIT = 3¶
- TYPE_LOAN = 4¶
- TYPE_MARKET = 5¶
- TYPE_JOINT = 6¶
- TYPE_CARD = 7¶
- TYPE_LIFE_INSURANCE = 8¶
- TYPE_PEE = 9¶
- TYPE_PERCO = 10¶
- TYPE_ARTICLE_83 = 11¶
- TYPE_RSP = 12¶
- TYPE_PEA = 13¶
- TYPE_CAPITALISATION = 14¶
- TYPE_PERP = 15¶
- TYPE_MADELIN = 16¶
- TYPE_MORTGAGE = 17¶
- TYPE_CONSUMER_CREDIT = 18¶
- TYPE_REVOLVING_CREDIT = 19¶
- TYPE_PER = 20¶
- TYPE_REAL_ESTATE = 21¶
- TYPE_CROWDLENDING = 22¶
- TYPE_LDDS = 23¶
- TYPE_PEL = 24¶
- TYPE_CSL = 25¶
- TYPE_CEL = 26¶
- TYPE_CAT = 27¶
- TYPE_LIVRET_A = 28¶
- TYPE_LIVRET_B = 29¶
- property valuation_diff_percent¶
- class Loan(id='0', url=NotLoaded)[source]¶
Bases:
Account
Account type dedicated to loans and credits.
- Variables:
url – (
str
) urllabel – (
str
) Pretty labelcurrency – (
str
) Currency (default: None)bank_name – (
str
) Bank Nametype – (
int
) Type of account (default: 0)owner_type – (
str
) Usage of accountbalance – (
Decimal
) Balance on this bank accountcoming – (
Decimal
) Sum of coming movementsiban – (
str
) International Bank Account Numberownership – (
str
) Relationship between the credentials owner (PSU) and the accountpaydate – (
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 – (
str
) Shown by the bank to identify your account ie XXXXX7489valuation_diff – (
Decimal
) +/- values totalvaluation_diff_ratio – (
Decimal
) +/- values ratiomanagement_type – (
str
) Management type of account (default: None)company_name – (
str
) Name of the company of the stock - only for employee savingsparent – (
BaseAccount
) Parent accountopening_date – (
date
,datetime
) Date when the account contract was created on the bankall_balances – (
list
) List of balances (default: [])party – (
AccountParty
) Party associated to the account (default: None)name – (
str
) Person nameaccount_label – (
str
) Label of the debited accountinsurance_label – (
str
) Label of the insurancetotal_amount – (
Decimal
) Total amount loanedavailable_amount – (
Decimal
) Amount availableused_amount – (
Decimal
) Amount already usedinsurance_amount – (
Decimal
) Amount of the loan’s insuranceinsurance_rate – (
Decimal
) Rate of the loan’s insurancesubscription_date – (
date
,datetime
) Date of subscription of the loanmaturity_date – (
date
,datetime
) Estimated end date of the loanstart_repayment_date – (
date
,datetime
) Date of start repayment of the loandeferred – (
bool
) If loan is deferredduration – (
int
) Duration of the loan given in monthsrate – (
Decimal
) Monthly rate of the loannb_payments_left – (
int
) Number of payments still duenb_payments_done – (
int
) Number of payments already donenb_payments_total – (
int
) Number total of paymentslast_payment_amount – (
Decimal
) Amount of the last payment donelast_payment_date – (
date
,datetime
) Date of the last payment donenext_payment_amount – (
Decimal
) Amount of next paymentnext_payment_date – (
date
,datetime
) Date of the next payment
- class Transaction(id='', url=NotLoaded, backend=None)[source]¶
Bases:
BaseObject
Bank transaction.
- Variables:
url – (
str
) urldate – (
date
,datetime
) Debit date on the bank statementrdate – (
date
,datetime
) Real date, when the payment has been made; usually extracted from the label or from credit card infovdate – (
date
,datetime
) Value date, or accounting date; usually for professional accountsbdate – (
date
,datetime
) Bank date, when the transaction appear on website (usually extracted from column date)type – (
int
) Type of transaction, use TYPE_* constants (default: 0)raw – (
str
) Raw label of the transactioncategory – (
str
) Category of the transactionlabel – (
str
) Pretty labelamount – (
Decimal
) Net amount of the transaction, used to compute account balancecoming – (
bool
) True if the transaction is not yet bookedcard – (
str
) Card number (if any)commission – (
Decimal
) Commission part on the transaction (in account currency)gross_amount – (
Decimal
) Amount of the transaction without the commissionoriginal_amount – (
Decimal
) Original net amount (in another currency)original_currency – (
str
) Currency of the original amountcountry – (
str
) Country of transactionoriginal_commission – (
Decimal
) Original commission (in another currency)original_commission_currency – (
str
) Currency of the original commissionoriginal_gross_amount – (
Decimal
) Original gross amount (in another currency)attachments – (
list
) List of files attached to the transactioninvestments – (
list
) List of investments related to the transaction (default: [])counterparty – (
TransactionCounterparty
) Counterparty of transactionbank_transaction_code – (
BankTransactionCode
) Bank transaction code of transaction
- TYPE_UNKNOWN = 0¶
- TYPE_TRANSFER = 1¶
- TYPE_ORDER = 2¶
- TYPE_CHECK = 3¶
- TYPE_DEPOSIT = 4¶
- TYPE_PAYBACK = 5¶
- TYPE_WITHDRAWAL = 6¶
- TYPE_CARD = 7¶
- TYPE_LOAN_PAYMENT = 8¶
- TYPE_BANK = 9¶
- TYPE_CASH_DEPOSIT = 10¶
- TYPE_CARD_SUMMARY = 11¶
- TYPE_DEFERRED_CARD = 12¶
- TYPE_INSTANT = 13¶
- TYPE_MARKET_ORDER = 14¶
- TYPE_MARKET_FEE = 15¶
- TYPE_ARBITRAGE = 16¶
- TYPE_PROFIT = 17¶
- unique_id(seen=None, account_id=None)[source]¶
Get an unique ID for the transaction based on date, amount and raw.
- Parameters:
seen (
set
) – if given, the method uses this set as a cache to (default:None
) 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 (default:None
) 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:
- exception AccountNotFound(msg='Account not found')[source]¶
Bases:
ObjectNotFound
Raised when an account is not found.
- class AccountType(*args, **kwargs)[source]¶
Bases:
Enum
- UNKNOWN = 0¶
- CHECKING = 1¶
Transaction, everyday transactions
- SAVINGS = 2¶
Savings/Deposit, can be used for every banking
- DEPOSIT = 3¶
Term of Fixed Deposit, has time/amount constraints
- LOAN = 4¶
Loan account
- MARKET = 5¶
Stock market or other variable investments
- JOINT = 6¶
Joint account
- CARD = 7¶
Card account
- LIFE_INSURANCE = 8¶
Life insurances
- PEE = 9¶
Employee savings PEE
- PERCO = 10¶
Employee savings PERCO
- ARTICLE_83 = 11¶
Article 83
- RSP = 12¶
Employee savings RSP
- PEA = 13¶
Share savings
- CAPITALISATION = 14¶
Life Insurance capitalisation
- PERP = 15¶
Retirement savings
- MADELIN = 16¶
Complementary retirement savings
- MORTGAGE = 17¶
Mortgage
- CONSUMER_CREDIT = 18¶
Consumer credit
- REVOLVING_CREDIT = 19¶
Revolving credit
- PER = 20¶
Pension plan PER
- REAL_ESTATE = 21¶
Real estate investment such as SCPI, OPCI, SCI
- CROWDLENDING = 22¶
Crowdlending accounts
- LDDS = 23¶
LDD/LDDS Livret de développement durable et solidaire
- PEL = 24¶
Plan épargne logement
- CSL = 25¶
Compte sur Livret
- CEL = 26¶
Compte épargne logement
- CAT = 27¶
Compte à terme
- LIVRET_A = 28¶
Livret A
- LIVRET_B = 29¶
Livret B
- class AccountOwnership[source]¶
Bases:
object
Relationship between the credentials owner (PSU) and the account
- OWNER = 'owner'¶
The PSU is the account owner
- CO_OWNER = 'co-owner'¶
The PSU is the account co-owner
- ATTORNEY = 'attorney'¶
The PSU is the account attorney
- class Balance(id='', url=NotLoaded, backend=None)[source]¶
Bases:
BaseObject
Object made to receive balance on one Account
- Variables:
url – (
str
) urlamount – (
Decimal
) Amount on this balancetype – (
int
) Type of balancecurrency – (
str
) Currencyreference_date – (
date
,datetime
) date of the balancelast_update – (
date
,datetime
) Last time balance was updatedcredit_included – (
bool
) If factoring is included in balance (default: False)label – (
str
) Bank name of the balancecalculated – (
bool
) If computation has been made on the balance (default: False)
- class AccountSchemeName(*args, **kwargs)[source]¶
Bases:
Enum
- IBAN = 'iban'¶
IBAN as defined in ISO 13616
- BBAN = 'bban'¶
Basic Bank Account Number, represents a country-specific bank account number
- SORT_CODE_ACCOUNT_NUMBER = 'sort_code_account_number'¶
Account Identification Number sometimes employed instead of IBAN (e.g.: in UK)
- CPAN = 'cpan'¶
Card PAN (masked or plain)
- TPAN = 'tpan'¶
Tokenized card PAN issued by a Token Service Provider to obfuscate the real PAN
- MPAN = 'mpan'¶
Card PAN where some digits were replaced for security reason
- BANK_PARTY_IDENTIFICATION = 'bank_party_identification'¶
BankPartyIdentification - Unique and unambiguous assignment made by a specific bank or similar financial institution to identify a relationship between the bank and its client.
Its definition can be found at page 13 of https://www.stet.eu/assets/files/PSD2/1-6-3/api-dsp2-stet-v1.6.3.1-part-2-functional-model.pdf
- class TransactionCounterparty(id='', url=NotLoaded, backend=None)[source]¶
Bases:
BaseObject
- Variables:
url – (
str
) urllabel – (
str
) Name of the other stakeholder (Creditor or debtor) (default: None)account_scheme_name – (
str
) Type of account Scheme (default: None)account_identification – (
str
) ID of the account (default: None)debtor – (
bool
) Type of the counterparty (debtor/creditor/null) (default: None)
- class PartyIdentity(id='', url=NotLoaded, backend=None)[source]¶
Bases:
BaseObject
Defines the identity of a party: - full_name: Full name of the party - role: Role of the party - is_user: Defines the link between the party and the connected PSU
- Variables:
- ROLE_UNKNOWN = 'unknown'¶
- ROLE_HOLDER = 'holder'¶
- ROLE_CO_HOLDER = 'co_holder'¶
- ROLE_ATTORNEY = 'attorney'¶
- ROLE_CUSTODIAN_FOR_MINOR = 'custodian_for_minor'¶
- ROLE_LEGAL_GUARDIAN = 'legal_guardian'¶
- ROLE_NOMINEE = 'nominee'¶
- ROLE_BENEFICIARY = 'beneficiary'¶
- ROLE_SUCCESSOR_ON_DEATH = 'successor_on_death'¶
- ROLE_TRUSTEE = 'trustee'¶
- class AccountParty(id='', url=NotLoaded, backend=None)[source]¶
Bases:
BaseObject
Defines all the information related to an account party: - party_identities: list of PartyIdentity elements - account_identifications : list of AccountIdentification elements
- class AccountIdentification(id='', url=NotLoaded, backend=None)[source]¶
Bases:
BaseObject
Defines the identification of a account: - scheme_name: Name of the account scheme type - identification: ID of the account
- class PartyRole(*args, **kwargs)[source]¶
Bases:
Enum
- UNKNOWN = 'unknown'¶
- HOLDER = 'holder'¶
- CO_HOLDER = 'co_holder'¶
- ATTORNEY = 'attorney'¶
- CUSTODIAN_FOR_MINOR = 'custodian_for_minor'¶
- LEGAL_GUARDIAN = 'legal_guardian'¶
- NOMINEE = 'nominee'¶
- BENEFICIARY = 'beneficiary'¶
- SUCCESSOR_ON_DEATH = 'successor_on_death'¶
- TRUSTEE = 'trustee'¶
- class CapAccountCheck[source]¶
Bases:
Capability
Capability to get accounts parties information.
- The expected structure is the following:
- AccountParty object
- party_identities (list of PartyIdentity elements):
full name
role
is_user
- account_identifications (list of type AccountIdentification elements):
scheme name
identification
- exception NoAccountsException[source]¶
Bases:
Exception
Raised by
CapBank.iter_accounts()
if we are sure there is no accounts.Sometimes we can’t parse find accounts on websites but that’s a scraping error. To attest we know that’s a real case, this exception is raised.
- class BalanceType(*args, **kwargs)[source]¶
Bases:
Enum
- CLOSING = 1¶
Current balance of the account
- PENDING = 2¶
Forecast balance of the account
- class BankTransactionCode(id='', url=NotLoaded, backend=None)[source]¶
Bases:
BaseObject
Object dedicating to bank transaction codes It follows the ISO20022 standards. See https://www.iso20022.org/catalogue-messages/additional-content-messages/external-code-sets