lists.arthurdejong.org
RSS feed

python-stdnum branch master updated. 1.14-2-g19d3f70

[Date Prev][Date Next] [Thread Prev][Thread Next]

python-stdnum branch master updated. 1.14-2-g19d3f70



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-stdnum".

The branch, master has been updated
       via  19d3f70c4835f8adecce2babcfec88177e82643a (commit)
      from  992dc2087f54274049a166ac87472e0b66450813 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://arthurdejong.org/git/python-stdnum/commit/?id=19d3f70c4835f8adecce2babcfec88177e82643a

commit 19d3f70c4835f8adecce2babcfec88177e82643a
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sat Sep 19 15:52:33 2020 +0200

    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 https://github.com/arthurdejong/python-stdnum/issues/238

diff --git a/stdnum/eu/vat.py b/stdnum/eu/vat.py
index d7c6026..987d8fc 100644
--- a/stdnum/eu/vat.py
+++ b/stdnum/eu/vat.py
@@ -1,7 +1,7 @@
 # vat.py - functions for handling European VAT numbers
 # coding: utf-8
 #
-# Copyright (C) 2012-2018 Arthur de Jong
+# Copyright (C) 2012-2020 Arthur de Jong
 # Copyright (C) 2015 Lionel Elie Mamane
 #
 # This library is free software; you can redistribute it and/or
@@ -43,7 +43,7 @@ from stdnum.exceptions import *
 from stdnum.util import clean, get_cc_module, get_soap_client
 
 
-_country_codes = set([
+MEMBER_STATES = set([
     'at', 'be', 'bg', 'cy', 'cz', 'de', 'dk', 'ee', 'es', 'fi', 'fr', 'gb',
     'gr', 'hr', 'hu', 'ie', 'it', 'lt', 'lu', 'lv', 'mt', 'nl', 'pl', 'pt',
     'ro', 'se', 'si', 'sk',
@@ -63,7 +63,7 @@ def _get_cc_module(cc):
     cc = cc.lower()
     if cc == 'el':
         cc = 'gr'
-    if cc not in _country_codes:
+    if cc not in MEMBER_STATES:
         return
     if cc not in _country_modules:
         _country_modules[cc] = get_cc_module(cc, 'vat')
@@ -105,7 +105,7 @@ def guess_country(number):
     for which it is valid. This returns lower case codes and returns gr (not
     el) for Greece."""
     return [cc
-            for cc in _country_codes
+            for cc in MEMBER_STATES
             if _get_cc_module(cc).is_valid(number)]
 
 

-----------------------------------------------------------------------

Summary of changes:
 stdnum/eu/vat.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
python-stdnum