8000 Make list of EU member states list of public API · viggo-devries/python-stdnum@19d3f70 · GitHub
[go: up one dir, main page]

Skip to content

Commit 19d3f70

Browse files
committed
Make list of EU member states list of public API
This provides stdnum.eu.vat.MEMBER_STATES. Note that Greece is listed with a country code of "gr" while the prefix used in VAT numbers is "el". Closes arthurdejong#238
1 parent 992dc20 commit 19d3f70

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdnum/eu/vat.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# vat.py - functions for handling European VAT numbers
22
# coding: utf-8
33
#
4-
# Copyright (C) 2012-2018 Arthur de Jong
4+
# Copyright (C) 2012-2020 Arthur de Jong
55
# Copyright (C) 2015 Lionel Elie Mamane
66
#
77
# This library is free software; you can redistribute it and/or
@@ -43,7 +43,7 @@
4343
from stdnum.util import clean, get_cc_module, get_soap_client
4444

4545

46-
_country_codes = set([
46+
MEMBER_STATES = set([
4747
'at', 'be', 'bg', 'cy', 'cz', 'de', 'dk', 'ee', 'es', 'fi', 'fr', 'gb',
4848
'gr', 'hr', 'hu', 'ie', 'it', 'lt', 'lu', 'lv', 'mt', 'nl', 'pl', 'pt',
4949
'ro', 'se', 'si', 'sk',
@@ -63,7 +63,7 @@ def _get_cc_module(cc):
6363
cc = cc.lower()
6464
if cc == 'el':
6565
cc = 'gr'
66-
if cc not in _country_codes:
66+
if cc not in MEMBER_STATES:
6767
return
6868
if cc not in _country_modules:
6969
_country_modules[cc] = get_cc_module(cc, 'vat')
@@ -105,7 +105,7 @@ def guess_country(number):
105105
for which it is valid. This returns lower case codes and returns gr (not
106106
el) for Greece."""
107107
return [cc
108-
for cc in _country_codes
108+
for cc in MEMBER_STATES
109109
if _get_cc_module(cc).is_valid(number)]
110110

111111

0 commit comments

Comments
 (0)
0