python-stdnum branch master updated. 1.3-1-g095dcbb
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
python-stdnum branch master updated. 1.3-1-g095dcbb
- From: Commits of the python-stdnum project <python-stdnum-commits [at] lists.arthurdejong.org>
- To: python-stdnum-commits [at] lists.arthurdejong.org
- Reply-to: python-stdnum-users [at] lists.arthurdejong.org
- Subject: python-stdnum branch master updated. 1.3-1-g095dcbb
- Date: Fri, 1 Apr 2016 22:08:22 +0200 (CEST)
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 095dcbb11f6fc9f5ddee90c27b4d466c4a75a7ed (commit)
from 41cecb5f2714d75a09e35385fd45b15fb8a03d29 (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 -----------------------------------------------------------------
http://arthurdejong.org/git/python-stdnum/commit/?id=095dcbb11f6fc9f5ddee90c27b4d466c4a75a7ed
commit 095dcbb11f6fc9f5ddee90c27b4d466c4a75a7ed
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Fri Apr 1 22:06:17 2016 +0200
Document accuracy of RFC check digit test
There is an online service that allows validating RFC numbers. It seems
there are a lot of numbers that do not match the check digit algorithm
which confirms disabling the check digit test by default is a good idea.
Also see https://github.com/arthurdejong/python-stdnum/issues/32
diff --git a/stdnum/mx/rfc.py b/stdnum/mx/rfc.py
index 72084e6..2e47238 100644
--- a/stdnum/mx/rfc.py
+++ b/stdnum/mx/rfc.py
@@ -31,13 +31,17 @@ person's name, followed by their birth date and 3 check
digits.
The first two check digits are calculated based on the person's or company's
full name. The last check digit is calculated over all the preceding digits
-in the number. However, it seems a lot of numbers are in use with invalid
-check digits so this test is disabled by default.
+in the number. However, it seems a lot of numbers (estimated at around 1.5%
+of all numbers) are in use with invalid check digits so this test is disabled
+by default.
More information can be found at:
http://www.sisi.org.mx/jspsi/documentos/2005/seguimiento/06101/0610100162005_065.doc
https://es.wikipedia.org/wiki/Registro_Federal_de_Contribuyentes_(M%C3%A9xico)
+An online validation service is available at:
+ https://portalsat.plataforma.sat.gob.mx/ConsultaRFC/
+
>>> validate('GODE 561231 GR8') # personal number
'GODE561231GR8'
>>> validate('MAB-930714-8T4') # company number
diff --git a/tests/test_mx_rfc.doctest b/tests/test_mx_rfc.doctest
index 57cb54b..2d5e2f3 100644
--- a/tests/test_mx_rfc.doctest
+++ b/tests/test_mx_rfc.doctest
@@ -416,7 +416,9 @@ numbers all have valid check digits (also see the list
below).
The following numbers were also found online, and while they appear to be in
use and referencing existing persons or organisations, the check digit does
-not validate.
+not validate. All of these have been checked to be valid on
+https://portalsat.plataforma.sat.gob.mx/ConsultaRFC/
+(note that this website expects ISO-8859-1 encoded numbers)
>>> numbers = '''
...
@@ -461,7 +463,6 @@ not validate.
... EQU810430193
... FAE8509042W7
... FIS0008226ZA
-... FISL7809158A0
... FME9305279N0
... FSA080813655
... FSI900505I74
@@ -484,12 +485,10 @@ not validate.
... LMI0811119C5
... LOCB6410225K0
... LOMM8110052J4
-... MAEE620525S14
... MALC721019EV6
... MDI931014D37
... MFA840320DX0
... MGR070820G78
-... MOJO6101239H7
... MPT000824LH7
... MSA850111TE1
... NIÑ7409256U1
@@ -499,7 +498,6 @@ not validate.
... OMD100907CJ4
... OPP010927SA5
... OTM090818KS6
-... PAC8608084O8
... PEJE480914ES9
... PERL640914HY9
... PPA100118E37
@@ -523,7 +521,6 @@ not validate.
... TPT890516JP5
... VAME720111AA4
... WME000218GK3
-... YLO031113IP4
... YME9610251W6
...
... '''
-----------------------------------------------------------------------
Summary of changes:
stdnum/mx/rfc.py | 8 ++++++--
tests/test_mx_rfc.doctest | 9 +++------
2 files changed, 9 insertions(+), 8 deletions(-)
hooks/post-receive
--
python-stdnum
--
To unsubscribe send an email to
python-stdnum-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/python-stdnum-commits/
- python-stdnum branch master updated. 1.3-1-g095dcbb,
Commits of the python-stdnum project