lists.arthurdejong.org
RSS feed

python-stdnum commit: r108 - in python-stdnum: . stdnum stdnum/sk

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

python-stdnum commit: r108 - in python-stdnum: . stdnum stdnum/sk



Author: arthur
Date: Fri Feb 10 14:27:39 2012
New Revision: 108
URL: http://arthurdejong.org/viewvc/python-stdnum?revision=108&view=revision

Log:
also make the stdnum.cz.rc module available as stdnum.sk.rc

Added:
   python-stdnum/stdnum/sk/
   python-stdnum/stdnum/sk/__init__.py
   python-stdnum/stdnum/sk/rc.py
Modified:
   python-stdnum/README
   python-stdnum/stdnum/__init__.py

Modified: python-stdnum/README
==============================================================================
--- python-stdnum/README        Fri Feb 10 14:23:21 2012        (r107)
+++ python-stdnum/README        Fri Feb 10 14:27:39 2012        (r108)
@@ -19,7 +19,7 @@
  * BTW (the Dutch VAT number)
  * CPF (Cadastro de Pessoas Físicas, the Brazillian national identification
    number)
- * RČ (Rodné číslo, the Czech birth numbers)
+ * RČ (Rodné číslo, the Slovak and Czech birth numbers)
  * SIREN (Système d'Identification du Répertoire des Entreprises, a French
    company identification number)
  * SSN (U.S. Social Security Number)

Modified: python-stdnum/stdnum/__init__.py
==============================================================================
--- python-stdnum/stdnum/__init__.py    Fri Feb 10 14:23:21 2012        (r107)
+++ python-stdnum/stdnum/__init__.py    Fri Feb 10 14:27:39 2012        (r108)
@@ -33,7 +33,7 @@
  * BTW (the Dutch VAT number)
  * CPF (Cadastro de Pessoas Físicas, the Brazillian national identification
    number)
- * RČ (Rodné číslo, the Czech birth numbers)
+ * RČ (Rodné číslo, the Slovak and Czech birth numbers)
  * SIREN (Système d'Identification du Répertoire des Entreprises, a French
    company identification number)
  * SSN (U.S. Social Security Number)

Added: python-stdnum/stdnum/sk/__init__.py
==============================================================================

Added: python-stdnum/stdnum/sk/rc.py
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ python-stdnum/stdnum/sk/rc.py       Fri Feb 10 14:27:39 2012        (r108)
@@ -0,0 +1,45 @@
+# rc.py - functions for handling Slovak birth numbers
+# coding: utf-8
+#
+# Copyright (C) 2012 Arthur de Jong
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA
+
+"""Module for handling Slovak birth numbers (RČ, Rodné číslo), the Slovak
+national identifier. The number can be 9 or 10 digits long. Numbers given
+out after January 1st 1954 should have 10 digits. The number includes the
+birth date of the person and their gender.
+
+>>> compact('710319/2745')
+'7103192745'
+>>> is_valid('7103192745')
+True
+>>> is_valid('991231123')
+True
+>>> is_valid('7103192746')  # invalid check digit
+False
+>>> is_valid('1103492745')  # invalid date
+False
+>>> is_valid('590312/123')  # 9 digit number in 1959
+False
+>>> format('7103192745')
+'710319/2745'
+"""
+
+# since this number is essentially the same as the Czech counterpart
+# (until 1993 the Czech Republic and Slovakia were one country)
+from stdnum.cz.rc import compact, is_valid, format
+__all__ = ['compact', 'is_valid', 'format']
-- 
To unsubscribe send an email to
python-stdnum-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/python-stdnum-commits/