Repository: identique/idnumbers (language: python)

Issue:
id number for Philippines
https://en.wikipedia.org/wiki/National_identification_number#Philippines


Discussion / hints:
no checksum, no parse
https://learn.microsoft.com/en-us/microsoft-365/compliance/sit-defn-philippines-unified-multi-purpose-identification-number?view=o365-worldwide

Fix patch:
diff --git a/README.md b/README.md
index e0c13240..00638fc9 100644
--- a/README.md
+++ b/README.md
@@ -62,6 +62,7 @@ print(id_data['citizenship'])
 * LKA - Sri Lanka
 * NGA - Nigeria
 * NZL - New Zealand
+* PHL - Philippine
 * SGP - Singapore
 * THA - Thailand
 * TWN - Taiwan
diff --git a/idnumbers/nationalid/PHL.py b/idnumbers/nationalid/PHL.py
new file mode 100644
index 00000000..48110289
--- /dev/null
+++ b/idnumbers/nationalid/PHL.py
@@ -0,0 +1,27 @@
+import re
+from types import SimpleNamespace
+from .util import validate_regexp
+
+
+class NationalID:
+    """
+    Philippines National ID number, PCN
+    https://en.wikipedia.org/wiki/National_identification_number#Philippines
+    """
+    METADATA = SimpleNamespace(**{
+        'iso3166_alpha2': 'PH',
+        # length without insignificant chars
+        'min_length': 12,
+        'max_length': 12,
+        'parsable': False,
+        'checksum': False,
+        'regexp': re.compile(r'^(\d{4}[ -]?\d{7}[ -]?\d)$')
+
+    })
+
+    @staticmethod
+    def validate(id_number: str) -> bool:
+        """
+        Validate the PHL id number
+        """
+        return validate_regexp(id_number, NationalID.METADATA.regexp)


Test patch:
diff --git a/idnumbers/nationalid/test_PHL.py b/idnumbers/nationalid/test_PHL.py
new file mode 100644
index 00000000..f1aba912
--- /dev/null
+++ b/idnumbers/nationalid/test_PHL.py
@@ -0,0 +1,16 @@
+from unittest import TestCase, main
+
+from idnumbers.nationalid import PHL
+
+
+class TestPHLValidation(TestCase):
+    def test_normal_case(self):
+        self.assertTrue(PHL.NationalID.validate('1234-5678912-3'))
+        self.assertTrue(PHL.NationalID.validate('123456789123'))
+
+    def test_error_case(self):
+        self.assertFalse(PHL.NationalID.validate('1234567890'))
+
+
+if __name__ == '__main__':
+    main()