lists.arthurdejong.org
RSS feed

python-stdnum branch master updated. 1.20-18-gbcd5018

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

python-stdnum branch master updated. 1.20-18-gbcd5018



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  bcd5018ee6842a13b07b168c6bc01c5d28c87406 (commit)
      from  020f1df5a4e51685227d6301b0d8ff25a7a7bc2b (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=bcd5018ee6842a13b07b168c6bc01c5d28c87406

commit bcd5018ee6842a13b07b168c6bc01c5d28c87406
Author: Victor Sordoillet <victor@groover.co>
Date:   Mon Sep 30 16:55:37 2024 +0200

    Add missing music industry ISRC country codes
    
    Closes https://github.com/arthurdejong/python-stdnum/pull/455
    Closes https://github.com/arthurdejong/python-stdnum/issues/454

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.

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

Summary of changes:
 stdnum/isrc.py          | 20 ++++++++++++++++++--
 tests/test_isrc.doctest |  4 ++++
 2 files changed, 22 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
python-stdnum