Skip to content

Commit

Permalink
Remove the iso3166 library as we already have pycountry
Browse files Browse the repository at this point in the history
  • Loading branch information
mdomke committed May 7, 2024
1 parent ec5a827 commit aa251c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ authors = [
]
dependencies = [
"importlib_resources>=5.10; python_version <= '3.11'",
"typing_extensions>=4.0; python_version <= '3.11'",
"iso3166",
"pycountry",
]

Expand Down
8 changes: 2 additions & 6 deletions schwifty/bic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import Any
from typing import TYPE_CHECKING

import iso3166
from pycountry import countries # type: ignore
from pycountry.db import Data # type: ignore

Expand Down Expand Up @@ -283,11 +282,8 @@ def _validate_structure(self, enforce_swift_compliance: bool = False) -> None:
raise exceptions.InvalidStructure(f"Invalid structure '{self!s}'")

def _validate_country_code(self) -> None:
country_code = self.country_code
try:
iso3166.countries_by_alpha2[country_code]
except KeyError as e:
raise exceptions.InvalidCountryCode(f"Invalid country code '{country_code}'") from e
if self.country is None:
raise exceptions.InvalidCountryCode(f"Invalid country code '{self.country_code}'")

@property
def is_valid(self) -> bool:
Expand Down

0 comments on commit aa251c2

Please sign in to comment.