Repository: identique/idnumbers (language: python)

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


Discussion / hints:

Fix patch:
diff --git a/idnumbers/nationalid/GEO.py b/idnumbers/nationalid/GEO.py
new file mode 100644
index 00000000..333bc7c7
--- /dev/null
+++ b/idnumbers/nationalid/GEO.py
@@ -0,0 +1,25 @@
+import re
+from types import SimpleNamespace
+from .util import validate_regexp
+
+
+class PersonalNumber:
+    """
+    Georgia personal number format
+    https://en.wikipedia.org/wiki/National_identification_number#Georgia
+    """
+    METADATA = SimpleNamespace(**{
+        'iso3166_alpha2': 'GE',
+        'min_length': 9,
+        'max_length': 9,
+        'parsable': False,
+        'checksum': False,
+        'regexp': re.compile(r'^\d{9}$')
+    })
+
+    @staticmethod
+    def validate(id_number: str) -> bool:
+        """
+        Validate personal number
+        """
+        return validate_regexp(id_number, PersonalNumber.METADATA.regexp)


Test patch:
diff --git a/tests/nationalid/test_GEO.py b/tests/nationalid/test_GEO.py
new file mode 100644
index 00000000..518f603c
--- /dev/null
+++ b/tests/nationalid/test_GEO.py
@@ -0,0 +1,11 @@
+from unittest import TestCase
+
+from idnumbers.nationalid import GEO
+
+
+class TestGEOValidation(TestCase):
+    def test_normal_case(self):
+        self.assertTrue(GEO.PersonalNumber.validate('023456789'))
+
+    def test_error_case(self):
+        self.assertFalse(GEO.PersonalNumber.validate('12345678'))