[Python-modules-commits] [python-stdnum] 02/05: Import python-stdnum_1.4.orig.tar.gz
Arthur de Jong
adejong at moszumanska.debian.org
Tue Jul 26 22:12:26 UTC 2016
This is an automated email from the git hooks/post-receive script.
adejong pushed a commit to branch master
in repository python-stdnum.
commit 19e31fda7da5ca0424a7703a94a0200da803c3a5
Author: Arthur de Jong <adejong at debian.org>
Date: Tue Jul 26 23:59:56 2016 +0200
Import python-stdnum_1.4.orig.tar.gz
---
ChangeLog | 199 +
NEWS | 19 +
PKG-INFO | 10 +-
README | 10 +-
docs/index.rst | 6 +
docs/stdnum.damm.rst | 5 +
docs/stdnum.fr.nif.rst | 5 +
docs/stdnum.fr.nir.rst | 5 +
docs/stdnum.fr.siret.rst | 5 +
docs/stdnum.gb.nhs.rst | 5 +
docs/stdnum.tr.tckimlik.rst | 5 +
getmybp.py | 4 +-
getnumlist.py | 5 +-
python_stdnum.egg-info/PKG-INFO | 10 +-
python_stdnum.egg-info/SOURCES.txt | 24 +-
stdnum/__init__.py | 10 +-
stdnum/br/cpf.py | 10 +-
stdnum/ch/ssn.py | 37 +-
stdnum/ch/uid.py | 7 +-
stdnum/ch/vat.py | 7 +-
stdnum/cn/loc.dat | 2 +-
stdnum/cusip.py | 5 +-
stdnum/damm.py | 93 +
stdnum/dk/cpr.py | 7 +-
stdnum/eu/vat.py | 15 +-
stdnum/{br/cpf.py => fr/nif.py} | 58 +-
stdnum/fr/nir.py | 104 +
stdnum/fr/siren.py | 2 +-
stdnum/fr/{siren.py => siret.py} | 79 +-
stdnum/{cusip.py => gb/nhs.py} | 63 +-
stdnum/iban.dat | 2 +-
stdnum/iban.py | 5 +-
stdnum/ie/vat.py | 35 +-
stdnum/imei.py | 3 +-
stdnum/imsi.dat | 587 +-
stdnum/isbn.dat | 16 +-
stdnum/isbn.py | 5 +-
stdnum/isil.dat | 5 +-
stdnum/isil.py | 13 +-
stdnum/isin.py | 3 +-
stdnum/iso6346.py | 14 +-
stdnum/issn.py | 5 +-
stdnum/mx/rfc.py | 16 +-
stdnum/nl/bsn.py | 9 +-
stdnum/nl/onderwijsnummer.py | 4 +
stdnum/numdb.py | 4 +-
stdnum/pl/regon.py | 9 +-
stdnum/tr/__init__.py | 0
stdnum/tr/tckimlik.py | 118 +
stdnum/us/ssn.py | 7 +-
stdnum/us/tin.py | 1 +
stdnum/util.py | 22 +-
stdnum/verhoeff.py | 5 +-
test_vies.py => test_tckimlik.py | 26 +-
test_vies.py | 2 +-
tests/test_asx.doctest | 12307 -------------------
tests/test_br_cpf.doctest | 7 -
...test_robustness.doctest => test_ch_ssn.doctest} | 25 +-
tests/test_damm.doctest | 93 +
...st_robustness.doctest => test_fr_siren.doctest} | 45 +-
tests/test_fr_siret.doctest | 85 +
tests/test_ie_vat.doctest | 48 +
tests/test_isil.doctest | 404 +
tests/test_markit_red6.doctest | 449 -
tests/test_mx_rfc.doctest | 9 +-
tests/test_robustness.doctest | 5 +-
tests/test_tr_tckimlik.doctest | 234 +
67 files changed, 2146 insertions(+), 13297 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a78944c..412b3ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,202 @@
+2016-07-26 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [3e4e9e2] getmybp.py, stdnum/cn/loc.dat, stdnum/iban.dat,
+ stdnum/imsi.dat, stdnum/isbn.dat, stdnum/isil.dat: Update
+ database files
+
+ This also updates the getmybp script to support the new layout.
+
+2016-07-26 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [3e344d1] stdnum/iso6346.py: Add formatting of ISO 6346 container
+ codes
+
+2016-07-26 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [aa1c298] getnumlist.py, stdnum/damm.py, tests/test_damm.doctest:
+ Implement Damm algorithm
+
+ This is a generic check digit algorithm. 2016-07-26 Arthur de
+Jong <arthur at arthurdejong.org>
+
+ * [411d038] stdnum/fr/nif.py: Fix French NIF format test
+
+ Fixes 2409ee9. 2016-07-26 Arthur de Jong
+<arthur at arthurdejong.org>
+
+ * [06e4165] stdnum/ch/ssn.py: Improve validation to Swiss SSN number
+
+ The EAN-13 number should start with 756.
+
+2016-07-26 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [1907c67] stdnum/br/cpf.py: Add documentation to Brazillian CPF
+
+2016-07-26 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [cf428ac] stdnum/iso6346.py: Add pointer to ISO 6346 information
+
+2016-07-26 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [011c0f0] stdnum/gb/nhs.py: Fix copyright notice
+
+2016-05-22 Dimitri Papadopoulos <dimitri.papadopoulos at cea.fr>
+
+ * [2409ee9] stdnum/fr/nif.py: Add NIF - French tax identification
+ number
+
+ Add module for NIF also known as SPI number.
+
+2016-07-26 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [43b58d3] stdnum/fr/nir.py: Move NIR check digit calculation
+ to function
+
+ This also fixes a number of formatting issues, improves the
+ module description and adds tests for the 2A and 2B departments.
+
+2016-05-29 Dimitri Papadopoulos <dimitri.papadopoulos at cea.fr>
+
+ * [879f2d3] stdnum/fr/nir.py: Improve French NIR validation
+
+ Please note that the 7th character of the NIR might be 'A' or
+ 'B'. Other than that the NIR contains digits only.
+
+2016-07-25 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [fd9f953] stdnum/fr/siren.py, stdnum/fr/siret.py,
+ tests/test_fr_siren.doctest, tests/test_fr_siret.doctest: Add
+ extra tests for SIREN and SIRET
+
+ This adds tests for a few numbers that have been found online
+ and allows the dot as a seprator because those numbers were found.
+
+ It also ensures that the SIREN validation is also called for
+ SIRET and adds a SIRET formatting function.
+
+2016-05-27 Yoann Aubineau <y.aubineau at criteo.com>
+
+ * [5ba3a87] stdnum/fr/siret.py: Add French SIRET number
+
+ Add a SIRET (Système d'Identification du Répertoire des
+ ETablissements, a French company etablishment identification
+ number) module.
+
+2016-05-29 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [dc708f0] stdnum/isil.py, tests/test_isil.doctest: Add more
+ ISIL tests
+
+ This moves a few of the tests from the module to a dedicated
+ test file and adds tests for a number of ISIL numbers found online.
+
+2016-05-29 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [4a57d84] stdnum/us/tin.py: Fix formatting of bulleted list
+
+2016-05-28 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [9b74840] stdnum/ch/ssn.py, tests/test_ch_ssn.doctest: Fix bug
+ in Swiss SSN validation
+
+ The validation was delegated to the EAN module but the number
+ is supposed to be an EAN-13 only and and EAN-8 was also accepted.
+
+ This also reformats the docstring.
+
+2016-05-28 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [f3c2491] stdnum/ie/vat.py, tests/test_ie_vat.doctest: Fix bug
+ in Irish VAT number validation
+
+ The last digits of the number that should be letters were not
+ tested to be letters which could result in ValueError being
+ raised for certain validations.
+
+ This also clarifies the documentation and adds a convert()
+ function to convert numbers from the old format (where the
+ second character would be a letter or symbol) to the new format
+ (7 digits followed by 1 or 2 letters).
+
+2016-05-28 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [b5397ed] tests/test_robustness.doctest: Small improvements
+ to tests
+
+ This includes a formatting fix and removes an unused variable
+ from a test.
+
+2016-05-28 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [d85b27f] stdnum/util.py: Fix get_module_description()
+
+ This fixes the initial implementation in 3f6d52a.
+
+2016-05-22 Dimitri Papadopoulos <dimitri.papadopoulos at cea.fr>
+
+ * [a1afa76] stdnum/fr/nir.py: Add French NIR
+
+ Add module for NIR also known as social security number.
+
+2016-05-09 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [0a2f39e] stdnum/gb/nhs.py: Add United Kingdom NHS number
+
+ Add module for United Kingdom National Health Service patient
+ identifier.
+
+2016-05-09 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [2126947] stdnum/numdb.py: Read numdb files in context manager
+
+ This ensures that the file is explicitly closed in the function
+ to avoid "unclosed file" warnings.
+
+ See: https://github.com/arthurdejong/python-stdnum/issues/33
+
+2016-04-11 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [e28b5e1] stdnum/ch/uid.py, stdnum/ch/vat.py, stdnum/cusip.py,
+ stdnum/dk/cpr.py, stdnum/iban.py, stdnum/imei.py, stdnum/isbn.py,
+ stdnum/isil.py, stdnum/isin.py, stdnum/issn.py, stdnum/mx/rfc.py,
+ stdnum/nl/bsn.py, stdnum/nl/onderwijsnummer.py, stdnum/pl/regon.py,
+ stdnum/tr/tckimlik.py, stdnum/us/ssn.py, stdnum/verhoeff.py:
+ Make more information links consistent
+
+ Also fix a docstring in stdnum.nl.bsn and add a pointer to
+ stdnum.nl.onderwijsnummer.
+
+2016-04-09 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [feab917] stdnum/eu/vat.py, stdnum/tr/tckimlik.py, stdnum/util.py:
+ Implement online TC Kimlik check
+
+ This refactors out the SOAP client function that was implemented
+ for VIES to the stdnum.utils module.
+
+2016-04-09 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [619b097] stdnum/tr/__init__.py, stdnum/tr/tckimlik.py,
+ tests/test_tr_tckimlik.doctest: Add Turkish personal identification
+ number
+
+2016-04-01 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [095dcbb] stdnum/mx/rfc.py, tests/test_mx_rfc.doctest: 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
+
+2016-03-05 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [41cecb5] ChangeLog, NEWS, getnumlist.py, setup.py,
+ stdnum/__init__.py: Get files ready for 1.3 release
+
2016-03-03 Arthur de Jong <arthur at arthurdejong.org>
* [6457734] getcnloc.py, getiban.py, stdnum/cn/loc.dat,
diff --git a/NEWS b/NEWS
index 50e94c4..1f8261d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,22 @@
+changes from 1.3 to 1.4
+-----------------------
+
+* add modules for the following number formats:
+ - NIF (Numéro d'Immatriculation Fiscale, French tax identification number)
+ provided by Dimitri Papadopoulos
+ - NIR (French personal identification number) provided by Dimitri
+ Papadopoulos
+ - SIRET (a French company establishment identification number) provided by
+ Yoann Aubineau
+ - NHS (United Kingdom National Health Service patient identifier)
+ - T.C. Kimlik No. (Turkish personal identification number)
+* add an implementation of the Damm algorithm
+* ensure data files are properly closed
+* documentation improvements
+* extend test suite
+* a number of minor bug fixes and improvements
+
+
changes from 1.2 to 1.3
-----------------------
diff --git a/PKG-INFO b/PKG-INFO
index d06668d..de3fdb0 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: python-stdnum
-Version: 1.3
+Version: 1.4
Summary: Python module to handle standardized numbers and codes
Home-page: http://arthurdejong.org/python-stdnum/
Author: Arthur de Jong
@@ -54,8 +54,12 @@ Description: Parse, validate and reformat standard numbers and codes.
* fi.associationid: Finnish Association Identifier
* fi.hetu: HETU (Henkilötunnus, Finnish personal identity code)
* fi.ytunnus: Y-tunnus (Finnish business identifier)
+ * fr.nif: NIF (Numéro d'Immatriculation Fiscale, French tax identification number)
+ * fr.nir: NIR (French personal identification number)
* fr.siren: SIREN (a French company identification number)
+ * fr.siret: SIRET (a French company establishment identification number)
* fr.tva: n° TVA (taxe sur la valeur ajoutée, French VAT number)
+ * gb.nhs: NHS (United Kingdom National Health Service patient identifier)
* gb.sedol: SEDOL number (Stock Exchange Daily Official List number)
* gb.vat: VAT (United Kingdom (and Isle of Man) VAT registration number)
* gr.vat: FPA, ΦΠΑ, ΑΦΜ (Αριθμός Φορολογικού Μητρώου, the Greek VAT number)
@@ -64,7 +68,7 @@ Description: Parse, validate and reformat standard numbers and codes.
* hu.anum: ANUM (Közösségi adószám, Hungarian VAT number)
* iban: IBAN (International Bank Account Number)
* ie.pps: PPS No (Personal Public Service Number, Irish personal number)
- * ie.vat: VAT (Irish VAT number)
+ * ie.vat: VAT (Irish tax reference number)
* imei: IMEI (International Mobile Equipment Identity)
* imo: IMO number (International Maritime Organization number)
* imsi: IMSI (International Mobile Subscriber Identity)
@@ -107,6 +111,7 @@ Description: Parse, validate and reformat standard numbers and codes.
* sk.dph: IČ DPH (IČ pre daň z pridanej hodnoty, Slovak VAT number)
* sk.rc: RČ (Rodné číslo, the Slovak birth number)
* sm.coe: COE (Codice operatore economico, San Marino national tax number)
+ * tr.tckimlik: T.C. Kimlik No. (Turkish personal identification number)
* us.atin: ATIN (U.S. Adoption Taxpayer Identification Number)
* us.ein: EIN (U.S. Employer Identification Number)
* us.itin: ITIN (U.S. Individual Taxpayer Identification Number)
@@ -117,6 +122,7 @@ Description: Parse, validate and reformat standard numbers and codes.
Furthermore a number of generic check digit algorithms are available:
+ * damm: The Damm algorithm
* iso7064.mod_11_10: The ISO 7064 Mod 11, 10 algorithm
* iso7064.mod_11_2: The ISO 7064 Mod 11, 2 algorithm
* iso7064.mod_37_2: The ISO 7064 Mod 37, 2 algorithm
diff --git a/README b/README
index f9be19e..4c8c8de 100644
--- a/README
+++ b/README
@@ -50,8 +50,12 @@ Currently this package supports the following formats:
* Finnish Association Identifier
* HETU (Henkilötunnus, Finnish personal identity code)
* Y-tunnus (Finnish business identifier)
+ * NIF (Numéro d'Immatriculation Fiscale, French tax identification number)
+ * NIR (French personal identification number)
* SIREN (a French company identification number)
+ * SIRET (a French company establishment identification number)
* n° TVA (taxe sur la valeur ajoutée, French VAT number)
+ * NHS (United Kingdom National Health Service patient identifier)
* SEDOL number (Stock Exchange Daily Official List number)
* VAT (United Kingdom (and Isle of Man) VAT registration number)
* FPA, ΦΠΑ, ΑΦΜ (Αριθμός Φορολογικού Μητρώου, the Greek VAT number)
@@ -60,7 +64,7 @@ Currently this package supports the following formats:
* ANUM (Közösségi adószám, Hungarian VAT number)
* IBAN (International Bank Account Number)
* PPS No (Personal Public Service Number, Irish personal number)
- * VAT (Irish VAT number)
+ * VAT (Irish tax reference number)
* IMEI (International Mobile Equipment Identity)
* IMO number (International Maritime Organization number)
* IMSI (International Mobile Subscriber Identity)
@@ -103,6 +107,7 @@ Currently this package supports the following formats:
* IČ DPH (IČ pre daň z pridanej hodnoty, Slovak VAT number)
* RČ (Rodné číslo, the Slovak birth number)
* COE (Codice operatore economico, San Marino national tax number)
+ * T.C. Kimlik No. (Turkish personal identification number)
* ATIN (U.S. Adoption Taxpayer Identification Number)
* EIN (U.S. Employer Identification Number)
* ITIN (U.S. Individual Taxpayer Identification Number)
@@ -114,6 +119,7 @@ Currently this package supports the following formats:
Furthermore a number of generic check digit algorithms are available:
* the Verhoeff algorithm
+ * the Damm algorithm
* the Luhn and Luhn mod N algorithms
* some algorithms described in ISO/IEC 7064: Mod 11, 2, Mod 37, 2,
Mod 97, 10, Mod 11, 10 and Mod 37, 36
@@ -152,7 +158,7 @@ also work with older versions of Python.
Copyright
---------
-Copyright (C) 2010-2015 Arthur de Jong and others
+Copyright (C) 2010-2016 Arthur de Jong and others
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/docs/index.rst b/docs/index.rst
index 59df1d5..b85a8e0 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -74,6 +74,7 @@ Generic check digit algorithms
.. autosummary::
:toctree:
+ damm
iso7064
luhn
verhoeff
@@ -126,8 +127,12 @@ Available formats
fi.associationid
fi.hetu
fi.ytunnus
+ fr.nif
+ fr.nir
fr.siren
+ fr.siret
fr.tva
+ gb.nhs
gb.sedol
gb.vat
gr.vat
@@ -179,6 +184,7 @@ Available formats
sk.dph
sk.rc
sm.coe
+ tr.tckimlik
us.atin
us.ein
us.itin
diff --git a/docs/stdnum.damm.rst b/docs/stdnum.damm.rst
new file mode 100644
index 0000000..e4bb865
--- /dev/null
+++ b/docs/stdnum.damm.rst
@@ -0,0 +1,5 @@
+stdnum.damm
+===========
+
+.. automodule:: stdnum.damm
+ :members:
\ No newline at end of file
diff --git a/docs/stdnum.fr.nif.rst b/docs/stdnum.fr.nif.rst
new file mode 100644
index 0000000..33b76ac
--- /dev/null
+++ b/docs/stdnum.fr.nif.rst
@@ -0,0 +1,5 @@
+stdnum.fr.nif
+=============
+
+.. automodule:: stdnum.fr.nif
+ :members:
\ No newline at end of file
diff --git a/docs/stdnum.fr.nir.rst b/docs/stdnum.fr.nir.rst
new file mode 100644
index 0000000..13ee2e7
--- /dev/null
+++ b/docs/stdnum.fr.nir.rst
@@ -0,0 +1,5 @@
+stdnum.fr.nir
+=============
+
+.. automodule:: stdnum.fr.nir
+ :members:
\ No newline at end of file
diff --git a/docs/stdnum.fr.siret.rst b/docs/stdnum.fr.siret.rst
new file mode 100644
index 0000000..a54ea58
--- /dev/null
+++ b/docs/stdnum.fr.siret.rst
@@ -0,0 +1,5 @@
+stdnum.fr.siret
+===============
+
+.. automodule:: stdnum.fr.siret
+ :members:
\ No newline at end of file
diff --git a/docs/stdnum.gb.nhs.rst b/docs/stdnum.gb.nhs.rst
new file mode 100644
index 0000000..f1d97d4
--- /dev/null
+++ b/docs/stdnum.gb.nhs.rst
@@ -0,0 +1,5 @@
+stdnum.gb.nhs
+=============
+
+.. automodule:: stdnum.gb.nhs
+ :members:
\ No newline at end of file
diff --git a/docs/stdnum.tr.tckimlik.rst b/docs/stdnum.tr.tckimlik.rst
new file mode 100644
index 0000000..fd9f38c
--- /dev/null
+++ b/docs/stdnum.tr.tckimlik.rst
@@ -0,0 +1,5 @@
+stdnum.tr.tckimlik
+==================
+
+.. automodule:: stdnum.tr.tckimlik
+ :members:
\ No newline at end of file
diff --git a/getmybp.py b/getmybp.py
index 53da015..f9dfa9c 100755
--- a/getmybp.py
+++ b/getmybp.py
@@ -2,7 +2,7 @@
# getmybp.py - script to donwnload data from Malaysian government site
#
-# Copyright (C) 2013 Arthur de Jong
+# Copyright (C) 2013-2016 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
@@ -43,7 +43,7 @@ def parse(f):
"""Parse the specified file."""
soup = BeautifulSoup.BeautifulSoup(f, convertEntities='html')
# find all table rows
- for tr in soup.find('div', id='inner-main').findAll('tr'):
+ for tr in soup.find('div', {'class': 'box-content'}).findAll('tr'):
# find the rows with four columns of text
tds = [
clean(''.join(x.string for x in td.findAll(text=True)))
diff --git a/getnumlist.py b/getnumlist.py
index 4c74479..c8b9b4d 100755
--- a/getnumlist.py
+++ b/getnumlist.py
@@ -28,7 +28,8 @@ from stdnum import util
# these are excluded
-algortihms = ('stdnum.verhoeff', 'stdnum.luhn', 'stdnum.iso7064')
+algortihms = (
+ 'stdnum.verhoeff', 'stdnum.luhn', 'stdnum.iso7064', 'stdnum.damm')
def get_number_modules():
@@ -36,7 +37,7 @@ def get_number_modules():
for module in util.get_number_modules():
if module.__name__ not in algortihms and \
not module.__name__.startswith('stdnum.iso7064'):
- yield module
+ yield module
if __name__ == '__main__':
print 'For README:'
diff --git a/python_stdnum.egg-info/PKG-INFO b/python_stdnum.egg-info/PKG-INFO
index d06668d..de3fdb0 100644
--- a/python_stdnum.egg-info/PKG-INFO
+++ b/python_stdnum.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: python-stdnum
-Version: 1.3
+Version: 1.4
Summary: Python module to handle standardized numbers and codes
Home-page: http://arthurdejong.org/python-stdnum/
Author: Arthur de Jong
@@ -54,8 +54,12 @@ Description: Parse, validate and reformat standard numbers and codes.
* fi.associationid: Finnish Association Identifier
* fi.hetu: HETU (Henkilötunnus, Finnish personal identity code)
* fi.ytunnus: Y-tunnus (Finnish business identifier)
+ * fr.nif: NIF (Numéro d'Immatriculation Fiscale, French tax identification number)
+ * fr.nir: NIR (French personal identification number)
* fr.siren: SIREN (a French company identification number)
+ * fr.siret: SIRET (a French company establishment identification number)
* fr.tva: n° TVA (taxe sur la valeur ajoutée, French VAT number)
+ * gb.nhs: NHS (United Kingdom National Health Service patient identifier)
* gb.sedol: SEDOL number (Stock Exchange Daily Official List number)
* gb.vat: VAT (United Kingdom (and Isle of Man) VAT registration number)
* gr.vat: FPA, ΦΠΑ, ΑΦΜ (Αριθμός Φορολογικού Μητρώου, the Greek VAT number)
@@ -64,7 +68,7 @@ Description: Parse, validate and reformat standard numbers and codes.
* hu.anum: ANUM (Közösségi adószám, Hungarian VAT number)
* iban: IBAN (International Bank Account Number)
* ie.pps: PPS No (Personal Public Service Number, Irish personal number)
- * ie.vat: VAT (Irish VAT number)
+ * ie.vat: VAT (Irish tax reference number)
* imei: IMEI (International Mobile Equipment Identity)
* imo: IMO number (International Maritime Organization number)
* imsi: IMSI (International Mobile Subscriber Identity)
@@ -107,6 +111,7 @@ Description: Parse, validate and reformat standard numbers and codes.
* sk.dph: IČ DPH (IČ pre daň z pridanej hodnoty, Slovak VAT number)
* sk.rc: RČ (Rodné číslo, the Slovak birth number)
* sm.coe: COE (Codice operatore economico, San Marino national tax number)
+ * tr.tckimlik: T.C. Kimlik No. (Turkish personal identification number)
* us.atin: ATIN (U.S. Adoption Taxpayer Identification Number)
* us.ein: EIN (U.S. Employer Identification Number)
* us.itin: ITIN (U.S. Individual Taxpayer Identification Number)
@@ -117,6 +122,7 @@ Description: Parse, validate and reformat standard numbers and codes.
Furthermore a number of generic check digit algorithms are available:
+ * damm: The Damm algorithm
* iso7064.mod_11_10: The ISO 7064 Mod 11, 10 algorithm
* iso7064.mod_11_2: The ISO 7064 Mod 11, 2 algorithm
* iso7064.mod_37_2: The ISO 7064 Mod 37, 2 algorithm
diff --git a/python_stdnum.egg-info/SOURCES.txt b/python_stdnum.egg-info/SOURCES.txt
index b5a340e..b0a30a0 100644
--- a/python_stdnum.egg-info/SOURCES.txt
+++ b/python_stdnum.egg-info/SOURCES.txt
@@ -12,6 +12,7 @@ getmybp.py
getnumlist.py
setup.cfg
setup.py
+test_tckimlik.py
test_vies.py
docs/conf.py
docs/index.rst
@@ -35,6 +36,7 @@ docs/stdnum.cusip.rst
docs/stdnum.cy.vat.rst
docs/stdnum.cz.dic.rst
docs/stdnum.cz.rc.rst
+docs/stdnum.damm.rst
docs/stdnum.de.vat.rst
docs/stdnum.de.wkn.rst
docs/stdnum.dk.cpr.rst
@@ -57,8 +59,12 @@ docs/stdnum.fi.alv.rst
docs/stdnum.fi.associationid.rst
docs/stdnum.fi.hetu.rst
docs/stdnum.fi.ytunnus.rst
+docs/stdnum.fr.nif.rst
+docs/stdnum.fr.nir.rst
docs/stdnum.fr.siren.rst
+docs/stdnum.fr.siret.rst
docs/stdnum.fr.tva.rst
+docs/stdnum.gb.nhs.rst
docs/stdnum.gb.sedol.rst
docs/stdnum.gb.vat.rst
docs/stdnum.gr.vat.rst
@@ -112,6 +118,7 @@ docs/stdnum.si.ddv.rst
docs/stdnum.sk.dph.rst
docs/stdnum.sk.rc.rst
docs/stdnum.sm.coe.rst
+docs/stdnum.tr.tckimlik.rst
docs/stdnum.us.atin.rst
docs/stdnum.us.ein.rst
docs/stdnum.us.itin.rst
@@ -128,6 +135,7 @@ python_stdnum.egg-info/requires.txt
python_stdnum.egg-info/top_level.txt
stdnum/__init__.py
stdnum/cusip.py
+stdnum/damm.py
stdnum/ean.py
stdnum/exceptions.py
stdnum/grid.py
@@ -213,9 +221,13 @@ stdnum/fi/associationid.py
stdnum/fi/hetu.py
stdnum/fi/ytunnus.py
stdnum/fr/__init__.py
+stdnum/fr/nif.py
+stdnum/fr/nir.py
stdnum/fr/siren.py
+stdnum/fr/siret.py
stdnum/fr/tva.py
stdnum/gb/__init__.py
+stdnum/gb/nhs.py
stdnum/gb/sedol.py
stdnum/gb/vat.py
stdnum/gr/__init__.py
@@ -282,6 +294,8 @@ stdnum/sk/dph.py
stdnum/sk/rc.py
stdnum/sm/__init__.py
stdnum/sm/coe.py
+stdnum/tr/__init__.py
+stdnum/tr/tckimlik.py
stdnum/us/__init__.py
stdnum/us/atin.py
stdnum/us/ein.dat
@@ -294,16 +308,16 @@ stdnum/us/tin.py
tests/numdb-test.dat
tests/test_al_nipt.doctest
tests/test_ar_cuit.doctest
-tests/test_asx.doctest
tests/test_bg_vat.doctest
tests/test_br_cnpj.doctest
-tests/test_br_cpf.doctest
+tests/test_ch_ssn.doctest
tests/test_ch_uid.doctest
tests/test_ch_vat.doctest
tests/test_cl_rut.doctest
tests/test_cn_ric.doctest
tests/test_co_nit.doctest
tests/test_cusip.doctest
+tests/test_damm.doctest
tests/test_de_wkn.doctest
tests/test_do_cedula.doctest
tests/test_do_rnc.doctest
@@ -313,20 +327,23 @@ tests/test_ec_ruc.doctest
tests/test_ee_ik.doctest
tests/test_eu_vat.doctest
tests/test_fi_hetu.doctest
+tests/test_fr_siren.doctest
+tests/test_fr_siret.doctest
tests/test_gb_sedol.doctest
tests/test_gb_vat.doctest
tests/test_iban.doctest
+tests/test_ie_vat.doctest
tests/test_imei.doctest
tests/test_is_kennitala.doctest
tests/test_isan.doctest
tests/test_isbn.doctest
+tests/test_isil.doctest
tests/test_isin.doctest
tests/test_ismn.doctest
tests/test_iso6346.doctest
tests/test_iso7064.doctest
tests/test_it_codicefiscale.doctest
tests/test_luhn.doctest
-tests/test_markit_red6.doctest
tests/test_meid.doctest
tests/test_mx_rfc.doctest
tests/test_my_nric.doctest
@@ -334,4 +351,5 @@ tests/test_no_mva.doctest
tests/test_pl_regon.doctest
tests/test_robustness.doctest
tests/test_ru_inn.doctest
+tests/test_tr_tckimlik.doctest
tests/test_verhoeff.doctest
\ No newline at end of file
diff --git a/stdnum/__init__.py b/stdnum/__init__.py
index 8da7c35..d12dcd4 100644
--- a/stdnum/__init__.py
+++ b/stdnum/__init__.py
@@ -66,8 +66,12 @@ Currently this package supports the following formats:
* fi.associationid: Finnish Association Identifier
* fi.hetu: HETU (Henkilötunnus, Finnish personal identity code)
* fi.ytunnus: Y-tunnus (Finnish business identifier)
+* fr.nif: NIF (Numéro d'Immatriculation Fiscale, French tax identification number)
+* fr.nir: NIR (French personal identification number)
* fr.siren: SIREN (a French company identification number)
+* fr.siret: SIRET (a French company establishment identification number)
* fr.tva: n° TVA (taxe sur la valeur ajoutée, French VAT number)
+* gb.nhs: NHS (United Kingdom National Health Service patient identifier)
* gb.sedol: SEDOL number (Stock Exchange Daily Official List number)
* gb.vat: VAT (United Kingdom (and Isle of Man) VAT registration number)
* gr.vat: FPA, ΦΠΑ, ΑΦΜ (Αριθμός Φορολογικού Μητρώου, the Greek VAT number)
@@ -76,7 +80,7 @@ Currently this package supports the following formats:
* hu.anum: ANUM (Közösségi adószám, Hungarian VAT number)
* iban: IBAN (International Bank Account Number)
* ie.pps: PPS No (Personal Public Service Number, Irish personal number)
-* ie.vat: VAT (Irish VAT number)
+* ie.vat: VAT (Irish tax reference number)
* imei: IMEI (International Mobile Equipment Identity)
* imo: IMO number (International Maritime Organization number)
* imsi: IMSI (International Mobile Subscriber Identity)
@@ -119,6 +123,7 @@ Currently this package supports the following formats:
* sk.dph: IČ DPH (IČ pre daň z pridanej hodnoty, Slovak VAT number)
* sk.rc: RČ (Rodné číslo, the Slovak birth number)
* sm.coe: COE (Codice operatore economico, San Marino national tax number)
+* tr.tckimlik: T.C. Kimlik No. (Turkish personal identification number)
* us.atin: ATIN (U.S. Adoption Taxpayer Identification Number)
* us.ein: EIN (U.S. Employer Identification Number)
* us.itin: ITIN (U.S. Individual Taxpayer Identification Number)
@@ -129,6 +134,7 @@ Currently this package supports the following formats:
Furthermore a number of generic check digit algorithms are available:
+* damm: The Damm algorithm
* iso7064.mod_11_10: The ISO 7064 Mod 11, 10 algorithm
* iso7064.mod_11_2: The ISO 7064 Mod 11, 2 algorithm
* iso7064.mod_37_2: The ISO 7064 Mod 37, 2 algorithm
@@ -153,4 +159,4 @@ parsing, validation, formatting or conversion functions.
# the version number of the library
-__version__ = '1.3'
+__version__ = '1.4'
diff --git a/stdnum/br/cpf.py b/stdnum/br/cpf.py
index 742d464..b8b4f6e 100644
--- a/stdnum/br/cpf.py
+++ b/stdnum/br/cpf.py
@@ -1,7 +1,7 @@
# cpf.py - functions for handling CPF numbers
# coding: utf-8
#
-# Copyright (C) 2011, 2012, 2013 Arthur de Jong
+# Copyright (C) 2011-2016 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
@@ -20,6 +20,14 @@
"""CPF (Cadastro de Pessoas Físicas, Brazillian national identifier).
+The Cadastro de Pessoas Físicas is the Brazilian identification number
+assigned to individuals for tax purposes. The number consists of 11 digits
+and includes two check digits.
+
+More information:
+
+* https://en.wikipedia.org/wiki/Cadastro_de_Pessoas_Físicas
+
>>> validate('390.533.447-05')
'39053344705'
>>> validate('231.002.999-00')
diff --git a/stdnum/ch/ssn.py b/stdnum/ch/ssn.py
index 548ffa1..57e88cf 100644
--- a/stdnum/ch/ssn.py
+++ b/stdnum/ch/ssn.py
@@ -1,6 +1,7 @@
-# vat.py - functions for handling Swiss social security numbers
+# ssn.py - functions for handling Swiss social security numbers
#
# Copyright (C) 2014 Denis Krienbuehl
+# Copyright (C) 2016 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
@@ -19,17 +20,16 @@
"""Swiss social security number ("Sozialversicherungsnummer").
-Also known as "Neue AHV Nummer".
+Also known as "Neue AHV Nummer". The Swiss Sozialversicherungsnummer is used
+to identify individuals for taxation and pension purposes.
-The Swiss Sozialversicherungsnummer is used to identify indivduals for taxation
-and pension purposes.
+The number is validated using EAN-13, though dashes are substituted for dots.
-The number is validated using EAN-13, though dashes are substitued for dots.
+More information:
+
+* https://en.wikipedia.org/wiki/National_identification_number#Switzerland
+* https://de.wikipedia.org/wiki/Sozialversicherungsnummer#Versichertennummer
->>> compact('756.9217.0769.85')
-'7569217076985'
->>> format('7569217076985')
-'756.9217.0769.85'
>>> validate('7569217076985')
'7569217076985'
>>> validate('756.9217.0769.85')
@@ -38,10 +38,16 @@ The number is validated using EAN-13, though dashes are substitued for dots.
Traceback (most recent call last):
...
InvalidChecksum: ...
+>>> validate('123.4567.8910.19')
+Traceback (most recent call last):
+ ...
+InvalidComponent: ...
+>>> format('7569217076985')
+'756.9217.0769.85'
"""
-from stdnum.exceptions import ValidationError
from stdnum import ean
+from stdnum.exceptions import *
from stdnum.util import clean
@@ -58,9 +64,14 @@ def format(number):
def validate(number):
- """Checks to see if the number provided is a valid
- Swiss Sozialversicherungsnummer."""
- return ean.validate(compact(number))
+ """Checks to see if the number provided is a valid Swiss
+ Sozialversicherungsnummer."""
+ number = compact(number)
+ if len(number) != 13:
+ raise InvalidLength()
+ if not number.startswith('756'):
+ raise InvalidComponent()
+ return ean.validate(number)
def is_valid(number):
diff --git a/stdnum/ch/uid.py b/stdnum/ch/uid.py
index 6622f50..62800bc 100644
--- a/stdnum/ch/uid.py
+++ b/stdnum/ch/uid.py
@@ -27,9 +27,10 @@ protected with a simple checksum.
This module only supports the "new" format that was introduced in 2011 which
completely replaced the "old" 6-digit format in 2014.
-More information is available at:
- https://www.uid.admin.ch/
- https://de.wikipedia.org/wiki/Unternehmens-Identifikationsnummer
+More information:
+
+* https://www.uid.admin.ch/
+* https://de.wikipedia.org/wiki/Unternehmens-Identifikationsnummer
>>> validate('CHE-100.155.212')
'CHE100155212'
diff --git a/stdnum/ch/vat.py b/stdnum/ch/vat.py
index a61c49e..6e32ea7 100644
--- a/stdnum/ch/vat.py
+++ b/stdnum/ch/vat.py
@@ -28,9 +28,10 @@ ajoutée in French), "IVA" (Imposta sul valore aggiunto in Italian) or "TPV"
This module only supports the "new" format that was introduced in 2011 which
completely replaced the "old" 6-digit format in 2014.
-More information is available at:
- https://www.ch.ch/en/value-added-tax-number-und-business-identification-number/
- https://www.uid.admin.ch/
+More information:
+
+* https://www.ch.ch/en/value-added-tax-number-und-business-identification-number/
+* https://www.uid.admin.ch/
>>> validate('CHE-107.787.577 IVA')
'CHE107787577IVA'
diff --git a/stdnum/cn/loc.dat b/stdnum/cn/loc.dat
index f7b1a79..96003c7 100644
--- a/stdnum/cn/loc.dat
+++ b/stdnum/cn/loc.dat
@@ -1,6 +1,6 @@
# generated from National Bureau of Statistics of the People's
# Republic of China, downloaded from https://github.com/cn/GB2260
-# 2016-03-02 22:38:33.696025
+# 2016-07-26 20:51:28.113057
110101 county="东城区" prefecture="市辖区" province="北京市"
110102 county="西城区" prefecture="市辖区" province="北京市"
110103 county="崇文区" prefecture="市辖区" province="北京市"
diff --git a/stdnum/cusip.py b/stdnum/cusip.py
index acd27d1..f685880 100644
--- a/stdnum/cusip.py
+++ b/stdnum/cusip.py
@@ -25,8 +25,9 @@ alphanumeric code where the first six characters identify the issuer,
followed by two digits that identify and a check digit.
More information:
- https://en.wikipedia.org/wiki/CUSIP
- https://www.cusip.com/
+
+* https://en.wikipedia.org/wiki/CUSIP
+* https://www.cusip.com/
>>> validate('DUS0421C5')
'DUS0421C5'
diff --git a/stdnum/damm.py b/stdnum/damm.py
new file mode 100644
index 0000000..dc93151
--- /dev/null
+++ b/stdnum/damm.py
@@ -0,0 +1,93 @@
+# damm.py - functions for performing the Damm checksum algorithm
+#
+# Copyright (C) 2016 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
+
+"""The Damm algorithm.
+
+The Damm algorithm is a check digit algorithm that should detect all
+single-digit errors and all adjacent transposition errors. Based on
+anti-symmetric quasigroup of order 10 it uses a substitution table.
+
+This implementation uses the table from Wikipedia by default but a custom
+table can be provided.
+
+More information:
+
+* https://en.wikipedia.org/wiki/Damm_algorithm
+
+>>> validate('572')
+Traceback (most recent call last):
+ ...
+InvalidChecksum: ...
+>>> calc_check_digit('572')
+'4'
+>>> validate('5724')
+'5724'
+"""
+
+from stdnum.exceptions import *
+
+
+_operation_table = (
+ (0, 3, 1, 7, 5, 9, 8, 6, 4, 2),
... 16648 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-stdnum.git
More information about the Python-modules-commits
mailing list