Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stdnum/isrc.py20
-rw-r--r--tests/test_isrc.doctest4
2 files changed, 22 insertions, 2 deletions
diff --git a/stdnum/isrc.py b/stdnum/isrc.py
index 7a2592c..5fc4e01 100644
--- a/stdnum/isrc.py
+++ b/stdnum/isrc.py
@@ -50,11 +50,27 @@ _isrc_re = re.compile(
# These special codes are allowed for ISRC
+# Source: https://isrc.ifpi.org/downloads/Valid_Characters.pdf
_country_codes = set(_iso_3116_1_country_codes + [
- 'QM', # US new registrants due to US codes became exhausted
+ 'BC', # Pro-música Brazil - Brasil
+ 'BK', # Pro-música Brazil - Brasil
+ 'BP', # Pro-música Brazil - Brasil
+ 'BX', # Pro-música Brazil - Brasil
+ 'CB', # Connect - Canada
'CP', # reserved for further overflow
'DG', # reserved for further overflow
- 'ZZ', # International ISRC Agency codes
+ 'FX', # SCPP - France
+ 'GX', # PPL UK - United Kingdom
+ 'KS', # KMCA - South Korea
+ 'QM', # US new registrants due to US codes became exhausted
+ 'QN', # International ISRC Agency codes - Worldwide
+ 'QT', # RIAA - US
+ 'QZ', # RIAA - US
+ 'UK', # PPL UK - United Kingdom
+ 'XK', # International ISRC Agency codes - Kosovo
+ 'YU', # International ISRC Agency codes - Former Yugoslavia before 2006
+ 'ZB', # RISA - South Africa
+ 'ZZ', # International ISRC Agency codes - Worldwide
])
diff --git a/tests/test_isrc.doctest b/tests/test_isrc.doctest
index bebe0c4..7911078 100644
--- a/tests/test_isrc.doctest
+++ b/tests/test_isrc.doctest
@@ -34,6 +34,10 @@ These are normal variations that should just work.
'USSKG1912345'
>>> isrc.validate('us-skg1912345')
'USSKG1912345'
+>>> isrc.validate('GX26J2400002')
+'GX26J2400002'
+>>> isrc.validate('FXR592300639')
+'FXR592300639'
Tests for mangling and incorrect country codes.