How to use the schwifty.IBAN function in schwifty

To help you get started, we’ve selected a few schwifty examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mdomke / schwifty / tests / test_iban.py View on Github external
def test_parse_iban_allow_invalid(number):
    iban = IBAN(number, allow_invalid=True)
    with pytest.raises(ValueError):
        iban.validate()
github mdomke / schwifty / tests / test_iban.py View on Github external
def test_parse_iban(number):
    iban = IBAN(number)
    assert iban.formatted == number
github mdomke / schwifty / tests / test_iban.py View on Github external
def test_iban_properties():
    iban = IBAN("DE42430609677000534100")
    assert iban.bank_code == "43060967"
    assert iban.branch_code == ""
    assert iban.account_code == "7000534100"
    assert iban.country_code == "DE"
    assert iban.bic == "GENODEM1GLS"
    assert iban.formatted == "DE42 4306 0967 7000 5341 00"
    assert iban.length == 22
    assert iban.country == countries.get(alpha_2="DE")
github mdomke / schwifty / tests / test_iban.py View on Github external
def test_magic_methods():
    iban = IBAN("DE42430609677000534100")
    assert iban == "DE42430609677000534100"
    assert iban == IBAN("DE42430609677000534100")
    assert iban != IBAN("ES9121000418450200051332")
    assert iban < IBAN("ES9121000418450200051332")

    assert str(iban) == "DE42430609677000534100"
    assert hash(iban) == hash("DE42430609677000534100")
    assert repr(iban) == ""
github mdomke / schwifty / tests / test_iban.py View on Github external
def test_invalid_iban(number):
    with pytest.raises(ValueError):
        IBAN(number)
github mdomke / schwifty / tests / test_iban.py View on Github external
def test_magic_methods():
    iban = IBAN("DE42430609677000534100")
    assert iban == "DE42430609677000534100"
    assert iban == IBAN("DE42430609677000534100")
    assert iban != IBAN("ES9121000418450200051332")
    assert iban < IBAN("ES9121000418450200051332")

    assert str(iban) == "DE42430609677000534100"
    assert hash(iban) == hash("DE42430609677000534100")
    assert repr(iban) == ""
github mdomke / schwifty / tests / test_iban.py View on Github external
def test_magic_methods():
    iban = IBAN("DE42430609677000534100")
    assert iban == "DE42430609677000534100"
    assert iban == IBAN("DE42430609677000534100")
    assert iban != IBAN("ES9121000418450200051332")
    assert iban < IBAN("ES9121000418450200051332")

    assert str(iban) == "DE42430609677000534100"
    assert hash(iban) == hash("DE42430609677000534100")
    assert repr(iban) == ""
github mdomke / schwifty / tests / test_iban.py View on Github external
def test_magic_methods():
    iban = IBAN("DE42430609677000534100")
    assert iban == "DE42430609677000534100"
    assert iban == IBAN("DE42430609677000534100")
    assert iban != IBAN("ES9121000418450200051332")
    assert iban < IBAN("ES9121000418450200051332")

    assert str(iban) == "DE42430609677000534100"
    assert hash(iban) == hash("DE42430609677000534100")
    assert repr(iban) == ""
github alephdata / aleph / services / extract-entities / entityextractor / result.py View on Github external
def __init__(self, ctx, label, start, end):
        super(IBANResult, self).__init__(ctx, label, start, end)
        try:
            iban = IBAN(label)
            self.key = self.label = iban.compact
            self.countries = [iban.country_code]
        except ValueError:
            self.valid = False
github byro / byro / src / byro / plugins / sepa / models.py View on Github external
def iban_parsed(self):
        with suppress(ValueError):
            if self.iban:
                return IBAN(self.iban)

        return None