faker.providers.bank.en_PH
¶
Package Contents¶
Classes¶
Implement default bank provider for Faker. |
|
Implement bank provider for |
Attributes¶
- class faker.providers.bank.en_PH.BankProvider(generator: Any)¶
Bases:
faker.providers.BaseProvider
Implement default bank provider for Faker.
Important
Bank codes, account numbers, and other ID’s generated by this provider are only valid in form, i.e. they conform to some standard/format, are of the expected lengths, and have valid checksums (where applicable). Results generated that turn out to be valid in real life are purely coincidental.
Sources:
- swift8(use_dataset: bool = False) str ¶
Generate an 8-digit SWIFT code.
This method uses |swift| under the hood with the
length
argument set to8
and with theprimary
argument omitted. All 8-digit SWIFT codes already refer to the primary branch/office.- Sample
- Sample
use_dataset=True
- swift11(primary: bool = False, use_dataset: bool = False) str ¶
Generate an 11-digit SWIFT code.
This method uses |swift| under the hood with the
length
argument set to11
. Ifprimary
is set toTrue
, the SWIFT code will always end with'XXX'
. All 11-digit SWIFT codes use this convention to refer to the primary branch/office.- Sample
- Sample
use_dataset=True
- swift(length: Optional[int] = None, primary: bool = False, use_dataset: bool = False) str ¶
Generate a SWIFT code.
SWIFT codes, reading from left to right, are composed of a 4 alphabet character bank code, a 2 alphabet character country code, a 2 alphanumeric location code, and an optional 3 alphanumeric branch code. This means SWIFT codes can only have 8 or 11 characters, so the value of
length
can only beNone
or the integers8
or11
. If the value isNone
, then a value of8
or11
will randomly be assigned.Because all 8-digit SWIFT codes already refer to the primary branch or office, the
primary
argument only has an effect if the value oflength
is11
. Ifprimary
isTrue
andlength
is11
, the 11-digit SWIFT codes generated will always end in'XXX'
to denote that they belong to primary branches/offices.For extra authenticity, localized providers may opt to include SWIFT bank codes, location codes, and branch codes used in their respective locales. If
use_dataset
isTrue
, this method will generate SWIFT codes based on those locale-specific codes if included. If those codes were not included, then it will behave as ifuse_dataset
wereFalse
, and in that mode, all those codes will just be randomly generated as per the specification.- Sample
- Sample
length=8
- Sample
length=8, use_dataset=True
- Sample
length=11
- Sample
length=11, primary=True
- Sample
length=11, use_dataset=True
- Sample
length=11, primary=True, use_dataset=True
- faker.providers.bank.en_PH.logger¶
- class faker.providers.bank.en_PH.Provider(generator: Any)¶
Bases:
faker.providers.bank.Provider
Implement bank provider for
en_PH
locale.- country_code = 'PH'¶
- bban_format = '################'¶
- swift_bank_codes = ('ANZB', 'AUBK', 'BKCH', 'BKKB', 'BNOR', 'BNPA', 'BOFA', 'BOPI', 'BOTK', 'BPDI', 'BPFS', 'BPGO',...¶
- swift_location_codes = ('22', '2X', 'M1', 'MM', 'MQ', 'MX')¶
- swift_branch_codes = ('CBU', 'EQI', 'TSU', 'XXX')¶
- bban() str ¶
Generate a Basic Bank Account Number (BBAN).
Warning
Philippine bank accounts do not have BBANs or IBANs, so any number generated by this method is a purely hypothetical number. Local bank account numbers are typically 10 or 12 digits long, so the BBAN format used in this implementation has been arbitrarily set to 16 digits to simulate a hypothetical standardization of account numbers. Using this method will log a warning regarding the hypotheticality of the result.
- iban() str ¶
Generate an International Bank Account Number (IBAN).
Warning
Philippine bank accounts do not have BBANs or IBANs, so any number generated by this method is a purely hypothetical number. This method uses hypothetical PH BBANs and the PH country code as inputs to the IBAN generation algorithm. Using this method will log a warning regarding the hypotheticality of the result.