Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Args:
country_code (str): ISO 3166 alpha2 country-code.
bank_code (str): Country specific bank-code.
Returns:
BIC: a BIC object generated from the given country code and bank code.
Raises:
ValueError: If the given bank code wasn't found in the registry
Note:
This currently only works for German bank-codes.
"""
try:
return cls(registry.get("bank_code")[(country_code, bank_code)]["bic"])
except KeyError:
raise ValueError(
"Invalid bank code {!r} for country {!r}".format(bank_code, country_code)
)