Repository: identique/idnumbers (language: python)

Issue:
id number for Iraq,_Republic_of
https://en.wikipedia.org/wiki/National_identification_number#Iraq,_Republic_of


Discussion / hints:

Fix patch:
diff --git a/idnumbers/nationalid/IRQ.py b/idnumbers/nationalid/IRQ.py
new file mode 100644
index 00000000..e4e4ae37
--- /dev/null
+++ b/idnumbers/nationalid/IRQ.py
@@ -0,0 +1,25 @@
+import re
+from types import SimpleNamespace
+from .util import validate_regexp
+
+
+class NationalID:
+    """
+    Iraq National Card number. not enough docs to research.
+    https://en.wikipedia.org/wiki/Iraq_National_Card
+    """
+    METADATA = SimpleNamespace(**{
+        'iso3166_alpha2': 'IQ',
+        'min_length': 12,
+        'max_length': 12,
+        'parsable': False,
+        'checksum': False,
+        'regexp': re.compile(r'^\d{12}$')
+    })
+
+    @staticmethod
+    def validate(id_number: str) -> bool:
+        """
+        Validate
+        """
+        return validate_regexp(id_number, NationalID.METADATA.regexp)


Test patch:
diff --git a/tests/nationalid/test_IRQ.py b/tests/nationalid/test_IRQ.py
new file mode 100644
index 00000000..a6d0910d
--- /dev/null
+++ b/tests/nationalid/test_IRQ.py
@@ -0,0 +1,10 @@
+from unittest import TestCase
+from idnumbers.nationalid import IRQ
+
+
+class TestIRQValidation(TestCase):
+    def test_normal_case(self):
+        self.assertTrue(IRQ.NationalID.validate('123456789012'))
+
+    def test_error_case(self):
+        self.assertFalse(IRQ.NationalID.validate('12345678901'))