python-stdnum branch master updated. 1.12-11-g42e096e
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
python-stdnum branch master updated. 1.12-11-g42e096e
- From: Commits of the python-stdnum project <python-stdnum-commits [at] lists.arthurdejong.org>
- To: python-stdnum-commits [at] lists.arthurdejong.org
- Reply-to: python-stdnum-users [at] lists.arthurdejong.org, python-stdnum-commits [at] lists.arthurdejong.org
- Subject: python-stdnum branch master updated. 1.12-11-g42e096e
- Date: Sun, 12 Jan 2020 11:32:56 +0100 (CET)
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 42e096e948e32d387ecdb8bf51abefdf17d21377 (commit)
via 87c195fac0760d0f5fa5f1675d3f919a658c8145 (commit)
from 0b30c4b86150e055a87dff21285a40c9d06df4ff (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=42e096e948e32d387ecdb8bf51abefdf17d21377
commit 42e096e948e32d387ecdb8bf51abefdf17d21377
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Sun Jan 12 11:14:12 2020 +0100
Add temporary and internal ISIN country codes
This adds a few temporary and internal country codes that are used by
various agencies so that they can also be validated. This does not mean
that all these numbers are globally valid.
Closes https://github.com/arthurdejong/python-stdnum/issues/158
diff --git a/stdnum/isin.py b/stdnum/isin.py
index b212de2..9463ec5 100644
--- a/stdnum/isin.py
+++ b/stdnum/isin.py
@@ -72,10 +72,14 @@ _iso_3116_1_country_codes = [
# These special code are allowed for ISIN
_country_codes = set(_iso_3116_1_country_codes + [
'EU', # European Union
+ 'QS', # internally used by Euroclear France
+ 'QS', # temporarily assigned in Germany
+ 'QT', # internally used in Switzerland
'XA', # CUSIP Global Services substitute agencies
'XB', # NSD Russia substitute agencies
'XC', # WM Datenservice Germany substitute agencies
'XD', # SIX Telekurs substitute agencies
+ 'XF', # internally assigned, not unique numbers
'XK', # temporary country code for Kosovo
'XS', # international securities
])
diff --git a/tests/test_isin.doctest b/tests/test_isin.doctest
index 379224e..568aa60 100644
--- a/tests/test_isin.doctest
+++ b/tests/test_isin.doctest
@@ -51,6 +51,7 @@ These have been found online and should all be valid numbers.
... AU00000GPHO9
... AU00000HAVO0
... AU00000IMFG2
+... XF0000C14922
... AU00000LSRO2
... AU00000MEUO4
... AU00000MFFO2
https://arthurdejong.org/git/python-stdnum/commit/?id=87c195fac0760d0f5fa5f1675d3f919a658c8145
commit 87c195fac0760d0f5fa5f1675d3f919a658c8145
Author: anwarbaroudi <m.a.baroudi96@gmail.com>
Date: Fri Dec 6 11:41:46 2019 -0500
Add three country codes to ISIN
This adds three missing country codes: 'AN' for 'Netherlands Antilles',
'CS' for 'Serbia and Montenegro' and 'XK' for 'Kosovo'.
Closes https://github.com/arthurdejong/python-stdnum/issues/173
Closes https://github.com/arthurdejong/python-stdnum/pull/174
Closes https://github.com/arthurdejong/python-stdnum/pull/176
diff --git a/stdnum/isin.py b/stdnum/isin.py
index e82cba6..b212de2 100644
--- a/stdnum/isin.py
+++ b/stdnum/isin.py
@@ -47,34 +47,38 @@ from stdnum.util import clean
# all valid ISO 3166-1 alpha-2 country codes
_iso_3116_1_country_codes = [
- 'AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT',
- 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI',
- 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY',
- 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN',
- 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM',
- 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK',
- 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL',
- 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM',
- 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR',
- 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN',
- 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS',
- 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK',
- 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW',
- 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP',
- 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM',
- 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW',
- 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM',
- 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF',
- 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW',
- 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI',
- 'VN', 'VU', 'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW']
-
-# the special XS country code is for international securities
-# substitute agencies can allocate an ISIN starting with XA (CUSIP Global
-# Services), XB (NSD Russia), XC (WM Datenservice Germany) or XD (SIX
-# Telekurs).
+ 'AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AN', 'AO', 'AQ', 'AR', 'AS',
+ 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH',
+ 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW',
+ 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM',
+ 'CN', 'CO', 'CR', 'CS', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ',
+ 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI',
+ 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH',
+ 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY',
+ 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO',
+ 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI',
+ 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK',
+ 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG',
+ 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU',
+ 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL',
+ 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK',
+ 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS',
+ 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK',
+ 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC',
+ 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT',
+ 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE',
+ 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW']
+
+# These special code are allowed for ISIN
_country_codes = set(_iso_3116_1_country_codes + [
- 'XS', 'EU', 'XA', 'XB', 'XC', 'XD'])
+ 'EU', # European Union
+ 'XA', # CUSIP Global Services substitute agencies
+ 'XB', # NSD Russia substitute agencies
+ 'XC', # WM Datenservice Germany substitute agencies
+ 'XD', # SIX Telekurs substitute agencies
+ 'XK', # temporary country code for Kosovo
+ 'XS', # international securities
+])
# the letters allowed in an ISIN
_alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
diff --git a/tests/test_isin.doctest b/tests/test_isin.doctest
index 84cb9fa..379224e 100644
--- a/tests/test_isin.doctest
+++ b/tests/test_isin.doctest
@@ -37,6 +37,7 @@ These have been found online and should all be valid numbers.
>>> numbers = '''
...
+... AN8068571086
... AU000000AAI6
... AU000000AAT3
... AU000000CDD7
-----------------------------------------------------------------------
Summary of changes:
stdnum/isin.py | 62 ++++++++++++++++++++++++++++---------------------
tests/test_isin.doctest | 2 ++
2 files changed, 37 insertions(+), 27 deletions(-)
hooks/post-receive
--
python-stdnum
- python-stdnum branch master updated. 1.12-11-g42e096e,
Commits of the python-stdnum project