woob.capabilities.bank.base
¶
- class CapBank[source]¶
Bases:
CapCollection
,CapCredentialsCheck
Capability of bank websites to see accounts and transactions.
- check_credentials() bool [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.
- iter_resources(objs: List[BaseObject], split_path: List[str]) Iterator[BaseObject] [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: str) Account [source]¶
Get an account from its ID.
- Parameters
id (
str
) – ID of the account- Return type
- Raises
- iter_history(account: Account) Iterator[Account] [source]¶
Iter history of transactions on a specific account.
- Parameters
account (
Account
) – account to get history- Return type
iter[
Transaction
]- Raises
- iter_coming(account: Account) Iterator[Transaction] [source]¶
Iter coming transactions on a specific account.
- Parameters
account (
Account
) – account to get coming transactions- Return type
iter[
Transaction
]- Raises
- class BaseAccount(id: Optional[str] = '0', url: Optional[str] = None)[source]¶
Bases:
BaseObject
,Currency
Generic class aiming to be parent of
Recipient
andAccount
.- Variables
url – (
str
) urllabel – (
str
) Pretty labelcurrency – (
str
) Currency (default: None)bank_name – (
str
) Bank Name
- property currency_text: str¶
- property ban: str¶
Bank Account Number part of IBAN
- class Account(id: Optional[str] = '0', url: Optional[str] = None)[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 ratiocompany_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: [])profile – (
AccountOwnerProfile
) Profile associated to the account ownerparty – (
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¶
- property valuation_diff_percent¶
- class Loan(id: Optional[str] = '0', url: Optional[str] = None)[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 ratiocompany_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: [])profile – (
AccountOwnerProfile
) Profile associated to the account ownerparty – (
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 loanduration – (
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 balancecard – (
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)investments – (
list
) List of investments related to the transaction (default: [])counterparty – (
TransactionCounterparty
) Counterparty 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¶
- unique_id(seen: Optional[set] = None, account_id: Optional[str] = None) str [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 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 AccountNotFound(msg: Optional[str] = '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
- 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 balance
- 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)
- 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 AccountOwnerProfile(id='', url=NotLoaded, backend=None)[source]¶
Bases:
TransactionCounterparty
AccountOwnerProfile contains the information related to the account and its owner: - account_scheme_name: scheme type of the account (IBAN or sort code + account number) - account_identification: value that identifies the account and is related to the scheme type - holder_name: full name of the account owner
- 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)holder_name – (
str
) Name of the account holder (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
url – (
str
) urlfull_name – (
str
) Full name of the party. (default: None)is_user – (
bool
) Is the party the connected PSU? (default: None)role – (
str
) Role of the party. (default: unknown)
- 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_BENEFICIARY = 'nominee_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
- Variables
url – (
str
) urlparty_identities – (
list
) Identities of the account party (default: [])account_identifications – (
list
) Identification information of the account (default: [])
- 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
- Variables
url – (
str
) urlscheme_name – (
str
) Name of the account scheme type (default: None)identification – (
str
) ID of the account (default: None)
- 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_BENEFICIARY = 'nominee_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