diff --git a/CHANGELOG b/CHANGELOG index 033a62c..0befa73 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Replace banknumber with python-stdnum + Version 0.22 - 2016-09-06 * Manage None values on fields diff --git a/retrofix/fields.py b/retrofix/fields.py index aa59152..94bb58d 100644 --- a/retrofix/fields.py +++ b/retrofix/fields.py @@ -29,7 +29,8 @@ except ImportError: from decimal import Decimal import re from datetime import datetime -import banknumber + +from stdnum.es.ccc import is_valid from .formatting import format_string, format_number from .exception import RetrofixException @@ -108,7 +109,7 @@ class Account(Char): def set_from_file(self, value): account = value.strip() - if account and not banknumber.check_code('ES', account): + if account and not is_valid(account): raise RetrofixException('Invalid bank account "%s" in field "%s"' % (value, self._name)) return super(Account, self).set_from_file(value) @@ -117,7 +118,7 @@ class Account(Char): account = value if account: account = account.strip() - if account and not banknumber.check_code('ES', account): + if account and not is_valid(account): raise RetrofixException('Invalid bank account "%s" in field "%s"' % (value, self._name)) return super(Account, self).set(value) diff --git a/setup.py b/setup.py index 2c22b69..6bd1c1d 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ setup(name=PACKAGE, ], license=LICENSE, install_requires=[ - 'banknumber >= 1.0', + 'python-stdnum >= 1.5', ], extras_require={}, zip_safe=False,