[Python-modules-commits] [python-stdnum] 01/05: Import python-stdnum_1.7.orig.tar.gz
Arthur de Jong
adejong at moszumanska.debian.org
Thu Sep 14 20:51:42 UTC 2017
This is an automated email from the git hooks/post-receive script.
adejong pushed a commit to branch master
in repository python-stdnum.
commit 1456eba3dce079fc96eb95b1fec17997fc13a4f1
Author: Arthur de Jong <adejong at debian.org>
Date: Tue Sep 12 23:11:18 2017 +0200
Import python-stdnum_1.7.orig.tar.gz
---
ChangeLog | 228 +++++++++++++++++++++
NEWS | 22 ++
PKG-INFO | 10 +-
README | 6 +
docs/index.rst | 8 +-
docs/stdnum.ca.bn.rst | 5 +
docs/stdnum.ca.sin.rst | 5 +
docs/stdnum.de.idnr.rst | 5 +
docs/stdnum.ee.registrikood.rst | 5 +
docs/stdnum.fi.veronumero.rst | 5 +
docs/stdnum.gb.upn.rst | 5 +
getisbn.py | 4 +-
online_check/README | 8 +-
online_check/check.js | 12 +-
online_check/stdnum.wsgi | 31 ++-
online_check/template.html | 4 +-
python_stdnum.egg-info/PKG-INFO | 10 +-
python_stdnum.egg-info/SOURCES.txt | 17 ++
setup.cfg | 7 +
setup.py | 4 +-
stdnum/__init__.py | 8 +-
stdnum/al/nipt.py | 7 +-
stdnum/ar/cbu.py | 6 +-
stdnum/ar/cuit.py | 4 +-
stdnum/at/businessid.py | 7 +-
stdnum/at/uid.py | 7 +-
stdnum/au/abn.py | 9 +-
stdnum/au/acn.py | 9 +-
stdnum/au/tfn.py | 9 +-
stdnum/be/vat.py | 7 +-
stdnum/bg/egn.py | 11 +-
stdnum/bg/pnf.py | 9 +-
stdnum/bg/vat.py | 7 +-
stdnum/br/cnpj.py | 8 +-
stdnum/br/cpf.py | 9 +-
stdnum/{fi => ca}/__init__.py | 11 +-
stdnum/{do/rnc.py => ca/bn.py} | 66 +++---
stdnum/{do/rnc.py => ca/sin.py} | 56 ++---
stdnum/ch/ssn.py | 8 +-
stdnum/ch/uid.py | 9 +-
stdnum/ch/vat.py | 11 +-
stdnum/cl/rut.py | 9 +-
stdnum/cn/loc.dat | 2 +-
stdnum/cn/ric.py | 15 +-
stdnum/co/nit.py | 9 +-
stdnum/cusip.py | 8 +-
stdnum/cy/vat.py | 7 +-
stdnum/cz/dic.py | 13 +-
stdnum/cz/rc.py | 9 +-
stdnum/damm.py | 25 ++-
stdnum/de/idnr.py | 94 +++++++++
stdnum/de/vat.py | 8 +-
stdnum/de/wkn.py | 8 +-
stdnum/dk/cpr.py | 12 +-
stdnum/dk/cvr.py | 8 +-
stdnum/do/cedula.py | 8 +-
stdnum/do/rnc.py | 6 +-
stdnum/ean.py | 12 +-
stdnum/ec/ci.py | 8 +-
stdnum/ec/ruc.py | 8 +-
stdnum/ee/ik.py | 6 +-
stdnum/ee/kmkr.py | 8 +-
stdnum/{eu/eic.py => ee/registrikood.py} | 60 +++---
stdnum/es/ccc.py | 6 +-
stdnum/es/cif.py | 8 +-
stdnum/es/cups.py | 10 +-
stdnum/es/dni.py | 8 +-
stdnum/es/iban.py | 4 +-
stdnum/es/nie.py | 8 +-
stdnum/es/nif.py | 10 +-
stdnum/es/referenciacatastral.py | 11 +-
stdnum/eu/at_02.py | 6 +-
stdnum/eu/eic.py | 8 +-
stdnum/eu/nace.dat | 2 +-
stdnum/eu/nace.py | 12 +-
stdnum/eu/vat.py | 26 +--
stdnum/fi/__init__.py | 2 +-
stdnum/fi/alv.py | 7 +-
stdnum/fi/associationid.py | 13 +-
stdnum/fi/hetu.py | 11 +-
stdnum/{rs/pib.py => fi/veronumero.py} | 46 +++--
stdnum/fi/ytunnus.py | 9 +-
stdnum/fr/nif.py | 6 +-
stdnum/fr/nir.py | 30 ++-
stdnum/fr/siren.py | 14 +-
stdnum/fr/siret.py | 13 +-
stdnum/fr/tva.py | 7 +-
stdnum/gb/nhs.py | 15 +-
stdnum/gb/sedol.py | 7 +-
stdnum/gb/upn.py | 108 ++++++++++
stdnum/gb/vat.py | 11 +-
stdnum/gr/vat.py | 7 +-
stdnum/grid.py | 6 +-
stdnum/hr/oib.py | 7 +-
stdnum/hu/anum.py | 7 +-
stdnum/iban.py | 11 +-
stdnum/ie/pps.py | 8 +-
stdnum/ie/vat.py | 8 +-
stdnum/imei.py | 10 +-
stdnum/imo.py | 10 +-
stdnum/imsi.dat | 341 +++++++++++++++++--------------
stdnum/imsi.py | 4 +-
stdnum/is_/kennitala.py | 15 +-
stdnum/is_/vsk.py | 8 +-
stdnum/isan.py | 22 +-
stdnum/isbn.dat | 49 +++--
stdnum/isbn.py | 38 ++--
stdnum/isil.dat | 2 +-
stdnum/isil.py | 12 +-
stdnum/isin.py | 8 +-
stdnum/ismn.py | 26 ++-
stdnum/iso6346.py | 6 +-
stdnum/iso7064/mod_11_10.py | 8 +-
stdnum/iso7064/mod_11_2.py | 8 +-
stdnum/iso7064/mod_37_2.py | 8 +-
stdnum/iso7064/mod_37_36.py | 8 +-
stdnum/iso7064/mod_97_10.py | 14 +-
stdnum/iso9362.py | 9 +-
stdnum/issn.py | 9 +-
stdnum/it/codicefiscale.py | 15 +-
stdnum/it/iva.py | 7 +-
stdnum/lei.py | 7 +-
stdnum/lt/pvm.py | 7 +-
stdnum/lu/tva.py | 7 +-
stdnum/luhn.py | 8 +-
stdnum/lv/pvn.py | 13 +-
stdnum/mc/tva.py | 7 +-
stdnum/meid.py | 27 +--
stdnum/mt/vat.py | 7 +-
stdnum/mx/rfc.py | 6 +-
stdnum/my/nric.py | 9 +-
stdnum/nl/brin.py | 11 +-
stdnum/nl/bsn.py | 9 +-
stdnum/nl/btw.py | 7 +-
stdnum/nl/onderwijsnummer.py | 12 +-
stdnum/nl/postcode.py | 7 +-
stdnum/no/mva.py | 9 +-
stdnum/no/orgnr.py | 9 +-
stdnum/numdb.py | 14 +-
stdnum/pl/nip.py | 9 +-
stdnum/pl/pesel.py | 9 +-
stdnum/pl/regon.py | 7 +-
stdnum/pt/nif.py | 7 +-
stdnum/ro/cf.py | 7 +-
stdnum/ro/cnp.py | 9 +-
stdnum/rs/pib.py | 9 +-
stdnum/ru/inn.py | 7 +-
stdnum/se/orgnr.py | 7 +-
stdnum/se/vat.py | 7 +-
stdnum/si/ddv.py | 7 +-
stdnum/sk/dph.py | 7 +-
stdnum/sk/rc.py | 2 +-
stdnum/sm/coe.py | 7 +-
stdnum/tr/__init__.py | 21 ++
stdnum/tr/tckimlik.py | 13 +-
stdnum/us/atin.py | 9 +-
stdnum/us/ein.dat | 2 +-
stdnum/us/ein.py | 9 +-
stdnum/us/itin.py | 9 +-
stdnum/us/ptin.py | 7 +-
stdnum/us/rtn.py | 7 +-
stdnum/us/ssn.py | 9 +-
stdnum/us/tin.py | 11 +-
stdnum/util.py | 17 +-
stdnum/verhoeff.py | 8 +-
tests/numdb-test.dat | 1 +
tests/test_al_nipt.doctest | 4 +-
tests/test_ca_bn.doctest | 151 ++++++++++++++
tests/test_de_idnr.doctest | 66 ++++++
tests/test_ee_registrikood.doctest | 148 ++++++++++++++
tests/test_eu_vat.doctest | 12 ++
tests/test_isbn.doctest | 230 ++++++++++++++++++++-
tests/test_ismn.doctest | 20 +-
tests/test_util.doctest | 50 +++++
tox.ini | 22 +-
175 files changed, 2235 insertions(+), 999 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f4593ce..c88a5d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,231 @@
+2017-09-12 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [28092b3] stdnum/damm.py: Add example with custom table to Damm
+
+2017-09-11 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [24d4a76] stdnum/cn/loc.dat, stdnum/eu/nace.dat, stdnum/imsi.dat,
+ stdnum/isbn.dat, stdnum/isil.dat: Update database files
+
+2017-09-11 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [5071636] getisbn.py: Update getisbn to allow TLSv1
+
+ The www.isbn-international.org site uses TLSv1 which seems to be
+ blocked by recent Python/OpenSSL combinations unless configured
+ otherwise.
+
+2017-09-11 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [edaad05] setup.cfg, tox.ini: Run flake8 from tox
+
+2017-09-10 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [0ce5d0b] stdnum/bg/egn.py, stdnum/cz/dic.py, stdnum/dk/cpr.py,
+ stdnum/es/cups.py, stdnum/es/referenciacatastral.py,
+ stdnum/eu/nace.py, stdnum/fr/nir.py, stdnum/fr/siren.py,
+ stdnum/iban.py, stdnum/it/codicefiscale.py, stdnum/lv/pvn.py,
+ stdnum/numdb.py, stdnum/ro/cnp.py, stdnum/util.py: Minor code
+ improvements (mostly PEP8)
+
+2017-09-10 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [e468c1b] stdnum/ch/vat.py, stdnum/cn/ric.py, stdnum/do/cedula.py,
+ stdnum/ee/ik.py, stdnum/ee/registrikood.py, stdnum/es/nif.py,
+ stdnum/fi/__init__.py, stdnum/fi/hetu.py, stdnum/gb/nhs.py,
+ stdnum/gb/upn.py, stdnum/gb/vat.py, stdnum/is_/kennitala.py,
+ stdnum/it/codicefiscale.py, stdnum/nl/onderwijsnummer.py,
+ stdnum/numdb.py, stdnum/rs/pib.py, stdnum/sk/rc.py,
+ stdnum/us/tin.py: Make import ordering consistent
+
+2017-09-10 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [1c27639] stdnum/al/nipt.py, stdnum/ar/cbu.py, stdnum/ar/cuit.py,
+ stdnum/at/businessid.py, stdnum/at/uid.py, stdnum/au/abn.py,
+ stdnum/au/acn.py, stdnum/au/tfn.py, stdnum/be/vat.py,
+ stdnum/bg/egn.py, stdnum/bg/pnf.py, stdnum/bg/vat.py,
+ stdnum/br/cnpj.py, stdnum/br/cpf.py, stdnum/ca/bn.py,
+ stdnum/ca/sin.py, stdnum/ch/ssn.py, stdnum/ch/uid.py,
+ stdnum/ch/vat.py, stdnum/cl/rut.py, stdnum/cn/ric.py,
+ stdnum/co/nit.py, stdnum/cusip.py, stdnum/cy/vat.py,
+ stdnum/cz/dic.py, stdnum/cz/rc.py, stdnum/damm.py,
+ stdnum/de/idnr.py, stdnum/de/vat.py, stdnum/de/wkn.py,
+ stdnum/dk/cpr.py, stdnum/dk/cvr.py, stdnum/do/cedula.py,
+ stdnum/do/rnc.py, stdnum/ean.py, stdnum/ec/ci.py, stdnum/ec/ruc.py,
+ stdnum/ee/ik.py, stdnum/ee/kmkr.py, stdnum/ee/registrikood.py,
+ stdnum/es/ccc.py, stdnum/es/cif.py, stdnum/es/cups.py,
+ stdnum/es/dni.py, stdnum/es/iban.py, stdnum/es/nie.py,
+ stdnum/es/nif.py, stdnum/es/referenciacatastral.py,
+ stdnum/eu/at_02.py, stdnum/eu/eic.py, stdnum/eu/nace.py,
+ stdnum/eu/vat.py, stdnum/fi/alv.py, stdnum/fi/associationid.py,
+ stdnum/fi/hetu.py, stdnum/fi/veronumero.py, stdnum/fi/ytunnus.py,
+ stdnum/fr/nif.py, stdnum/fr/nir.py, stdnum/fr/siren.py,
+ stdnum/fr/siret.py, stdnum/fr/tva.py, stdnum/gb/nhs.py,
+ stdnum/gb/sedol.py, stdnum/gb/upn.py, stdnum/gb/vat.py,
+ stdnum/gr/vat.py, stdnum/grid.py, stdnum/hr/oib.py,
+ stdnum/hu/anum.py, stdnum/iban.py, stdnum/ie/pps.py,
+ stdnum/ie/vat.py, stdnum/imei.py, stdnum/imo.py,
+ stdnum/imsi.py, stdnum/is_/kennitala.py, stdnum/is_/vsk.py,
+ stdnum/isan.py, stdnum/isbn.py, stdnum/isil.py, stdnum/isin.py,
+ stdnum/ismn.py, stdnum/iso6346.py, stdnum/iso7064/mod_11_10.py,
+ stdnum/iso7064/mod_11_2.py, stdnum/iso7064/mod_37_2.py,
+ stdnum/iso7064/mod_37_36.py, stdnum/iso7064/mod_97_10.py,
+ stdnum/iso9362.py, stdnum/issn.py, stdnum/it/codicefiscale.py,
+ stdnum/it/iva.py, stdnum/lei.py, stdnum/lt/pvm.py,
+ stdnum/lu/tva.py, stdnum/luhn.py, stdnum/lv/pvn.py,
+ stdnum/mc/tva.py, stdnum/meid.py, stdnum/mt/vat.py,
+ stdnum/mx/rfc.py, stdnum/my/nric.py, stdnum/nl/brin.py,
+ stdnum/nl/bsn.py, stdnum/nl/btw.py, stdnum/nl/onderwijsnummer.py,
+ stdnum/nl/postcode.py, stdnum/no/mva.py, stdnum/no/orgnr.py,
+ stdnum/numdb.py, stdnum/pl/nip.py, stdnum/pl/pesel.py,
+ stdnum/pl/regon.py, stdnum/pt/nif.py, stdnum/ro/cf.py,
+ stdnum/ro/cnp.py, stdnum/rs/pib.py, stdnum/ru/inn.py,
+ stdnum/se/orgnr.py, stdnum/se/vat.py, stdnum/si/ddv.py,
+ stdnum/sk/dph.py, stdnum/sm/coe.py, stdnum/tr/__init__.py,
+ stdnum/tr/tckimlik.py, stdnum/us/atin.py, stdnum/us/ein.py,
+ stdnum/us/itin.py, stdnum/us/ptin.py, stdnum/us/rtn.py,
+ stdnum/us/ssn.py, stdnum/us/tin.py, stdnum/verhoeff.py: Docstring
+ improvements
+
+2017-09-08 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [2cc39ea] stdnum/cz/dic.py, tests/test_eu_vat.doctest: Fix Czech
+ DIČ check digit calculation
+
+ This fixes a bug in the check digit calculation for the 9-digit
+ numbers that start with a 6 for individuals without a RČ. This
+ also adds a few tests for Czech VAT numbers.
+
+ See https://github.com/arthurdejong/python-stdnum/issues/51
+
+2017-09-04 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [d24a439] stdnum/ee/registrikood.py,
+ tests/test_ee_registrikood.doctest: Add Estonian Registrikood
+
+ This is based on what was done by Mohammed Salman of Holvi. This
+ adds more tests and validates the check digit.
+
+ This uses the check digit algorithm from Isikukood which seems
+ to work with all tested numbers although there is no confirmation
+ that this is the correct algorithm.
+
+2017-08-25 Mohammed Salman <mohammed at holvi.com>
+
+ * [53cc0dc] stdnum/de/idnr.py, tests/test_de_idnr.doctest: Add
+ support for German tax id number
+
+2017-08-30 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [a71a1ac] stdnum/isbn.py, tests/test_isbn.doctest: Check bookland
+ code in ISBN
+
+ This ensures that an InvalidComponent() exception is raised when
+ an unknown EAN bookland code is found. It will also raise this
+ exception when using to_isbn10() when not using the 978 code.
+
+2017-08-28 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [8f6fa7d] setup.cfg, stdnum/iban.py, stdnum/ismn.py,
+ stdnum/meid.py, stdnum/numdb.py, stdnum/util.py,
+ tests/numdb-test.dat, tests/test_util.doctest: Ensure 100%
+ branch coverage
+
+ This ensures that the tests fail if 100% branch coverage is
+ not achieved. It also adds some pragma statements for code that
+ cannot be covered or is Python version dependent.
+
+ Furthermore, the get_module_list() function was removed
+ from stdnum.util and more tests were made from stdnum.util
+ and stdnum.numdb. The functionality to call format() in a
+ country-specific IBAN implementation was also dropped because
+ it was not used.
+
+2017-08-27 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [fbc92f8] stdnum/gb/upn.py: Add English Unique Pupil Number (UPN)
+
+2017-08-26 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [b8389eb] stdnum/ca/bn.py, tests/test_ca_bn.doctest: Add Canadian
+ Business Number (BN)
+
+2017-08-26 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [efd2eb9] stdnum/ca/__init__.py, stdnum/ca/sin.py: Add Canadian
+ Social Insurance Number (SIN)
+
+2017-08-24 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [b8e12d6] setup.cfg: Ensure all Python files are in coverage report
+
+2017-08-17 Mohammed Salman <mohammed at holvi.com>
+
+ * [0c91b43] stdnum/fi/veronumero.py: Implement Finnish individual
+ tax number validation
+
+2017-07-11 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [bd0c7c7] online_check/check.js, online_check/stdnum.wsgi,
+ online_check/template.html: Include search term in online form
+
+ This also makes the Javascript regular expression used for
+ highlighting links the same as the Python equivalent.
+
+2017-06-02 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [81446fd] stdnum/iso7064/mod_97_10.py: Use slightly more
+ compact code
+
+ This changes the alphanumeric to numeric translation to be
+ slightly more compact and slightly faster.
+
+2017-04-16 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [ed9ac5b] tests/test_isbn.doctest: Add a few ISBNs found online
+
+ This adds a number of ISBNs found online from various sources
+ to the test suite.
+
+2017-04-15 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [57c12d8] stdnum/ismn.py, tests/test_ismn.doctest: An ISMN can
+ only be 10 or 13 digits
+
+ This also adds the test that an ISMN should start with 9790.
+
+2017-04-15 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [6fb2e89] stdnum/isbn.py, tests/test_isbn.doctest: Fix conversion
+ of 9 digit ISBN to ISBN13
+
+2017-04-13 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [5604d91] docs/index.rst, setup.py, stdnum/fr/nir.py,
+ stdnum/fr/siren.py, stdnum/gb/nhs.py, stdnum/isil.py,
+ stdnum/iso6346.py, stdnum/lv/pvn.py, stdnum/nl/brin.py,
+ stdnum/us/ein.dat, tests/test_al_nipt.doctest: Switch to HTTPS URLs
+
+2017-04-13 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [d14ea3b] online_check/README, online_check/check.js,
+ online_check/stdnum.wsgi: Show possible conversions in online check
+
+ This shows possible converted values. For example it will show
+ ISBN13 conversions for ISBN10 values.
+
+2017-04-13 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [6b588d1] stdnum/damm.py: Fix bug in damm.is_valid() function
+
+2017-04-11 Arthur de Jong <arthur at arthurdejong.org>
+
+ * [35542c1] ChangeLog, MANIFEST.in, NEWS, README, docs/index.rst,
+ docs/stdnum.ar.cbu.rst, docs/stdnum.eu.eic.rst,
+ docs/stdnum.eu.nace.rst, docs/stdnum.lei.rst,
+ docs/stdnum.mc.tva.rst, docs/stdnum.rs.pib.rst, stdnum/__init__.py:
+ Get files ready for 1.6 release
+
2017-04-10 Arthur de Jong <arthur at arthurdejong.org>
* [93459d3] stdnum/cn/loc.dat, stdnum/eu/nace.dat, stdnum/iban.dat,
diff --git a/NEWS b/NEWS
index d1aee8e..b71bcf2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,25 @@
+changes from 1.6 to 1.7
+-----------------------
+
+* add modules for the following number formats:
+ - BN (Canadian Business Number)
+ - SIN (Canadian Social Insurance Number)
+ - IdNr (Steuerliche Identifikationsnummer, German personal tax number)
+ (thanks Mohammed Salman of Holvi)
+ - Registrikood (Estonian organisation registration code)
+ (thanks Mohammed Salman of Holvi)
+ - Veronumero (Finnish individual tax number)
+ (thanks Mohammed Salman of Holvi)
+ - UPN (English Unique Pupil Number)
+* fix a bug in the Czech DIČ check digit calculation
+* fix conversion of 9 digit ISBN to ISBN13
+* fix a bug in the Damm is_valid() function
+* more validation of 13-digit ISBN values
+* more validation of ISMN values
+* various code and test improvements (100% branch coverage now)
+* documentation improvements
+
+
changes from 1.5 to 1.6
-----------------------
diff --git a/PKG-INFO b/PKG-INFO
index e09cbcb..f9e4652 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,8 +1,8 @@
Metadata-Version: 1.1
Name: python-stdnum
-Version: 1.6
+Version: 1.7
Summary: Python module to handle standardized numbers and codes
-Home-page: http://arthurdejong.org/python-stdnum/
+Home-page: https://arthurdejong.org/python-stdnum/
Author: Arthur de Jong
Author-email: arthur at arthurdejong.org
License: LGPL
@@ -27,6 +27,8 @@ Description: Parse, validate and reformat standard numbers and codes.
* bg.vat: VAT (Идентификационен номер по ДДС, Bulgarian VAT number)
* br.cnpj: CNPJ (Cadastro Nacional da Pessoa Jurídica, Brazillian company identifier)
* br.cpf: CPF (Cadastro de Pessoas Físicas, Brazillian national identifier)
+ * ca.bn: BN (Canadian Business Number)
+ * ca.sin: SIN (Canadian Social Insurance Number)
* ch.ssn: Swiss social security number ("Sozialversicherungsnummer")
* ch.uid: UID (Unternehmens-Identifikationsnummer, Swiss business identifier)
* ch.vat: VAT, MWST, TVA, IVA, TPV (Mehrwertsteuernummer, the Swiss VAT number)
@@ -37,6 +39,7 @@ Description: Parse, validate and reformat standard numbers and codes.
* cy.vat: Αριθμός Εγγραφής Φ.Π.Α. (Cypriot VAT number)
* cz.dic: DIČ (Daňové identifikační číslo, Czech VAT number)
* cz.rc: RČ (Rodné číslo, the Czech birth number)
+ * de.idnr: IdNr (Steuerliche Identifikationsnummer, German personal tax number)
* de.vat: Ust ID Nr. (Umsatzsteur Identifikationnummer, German VAT number)
* de.wkn: Wertpapierkennnummer (German securities identification code)
* dk.cpr: CPR (personnummer, the Danish citizen number)
@@ -48,6 +51,7 @@ Description: Parse, validate and reformat standard numbers and codes.
* ec.ruc: RUC (Registro Único de Contribuyentes, Ecuadorian company tax number)
* ee.ik: Isikukood (Estonian Personcal ID number)
* ee.kmkr: KMKR (Käibemaksukohuslase, Estonian VAT number)
+ * ee.registrikood: Registrikood (Estonian organisation registration code)
* es.ccc: CCC (Código Cuenta Corriente, Spanish Bank Account Code)
* es.cif: CIF (Certificado de Identificación Fiscal, Spanish company tax number)
* es.cups: CUPS (Código Unificado de Punto de Suministro, Supply Point Unified Code)
@@ -63,6 +67,7 @@ Description: Parse, validate and reformat standard numbers and codes.
* fi.alv: ALV nro (Arvonlisäveronumero, Finnish VAT number)
* fi.associationid: Finnish Association Identifier
* fi.hetu: HETU (Henkilötunnus, Finnish personal identity code)
+ * fi.veronumero: Veronumero (Finnish individual tax number)
* 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)
@@ -71,6 +76,7 @@ Description: Parse, validate and reformat standard numbers and codes.
* 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.upn: UPN (English Unique Pupil Number)
* gb.vat: VAT (United Kingdom (and Isle of Man) VAT registration number)
* gr.vat: FPA, ΦΠΑ, ΑΦΜ (Αριθμός Φορολογικού Μητρώου, the Greek VAT number)
* grid: GRid (Global Release Identifier)
diff --git a/README b/README
index 02ce9de..08dec83 100644
--- a/README
+++ b/README
@@ -23,6 +23,8 @@ Currently this package supports the following formats:
* VAT (Идентификационен номер по ДДС, Bulgarian VAT number)
* CNPJ (Cadastro Nacional da Pessoa Jurídica, Brazillian company identifier)
* CPF (Cadastro de Pessoas Físicas, Brazillian national identifier)
+ * BN (Canadian Business Number)
+ * SIN (Canadian Social Insurance Number)
* Swiss social security number ("Sozialversicherungsnummer")
* UID (Unternehmens-Identifikationsnummer, Swiss business identifier)
* VAT, MWST, TVA, IVA, TPV (Mehrwertsteuernummer, the Swiss VAT number)
@@ -33,6 +35,7 @@ Currently this package supports the following formats:
* Αριθμός Εγγραφής Φ.Π.Α. (Cypriot VAT number)
* DIČ (Daňové identifikační číslo, Czech VAT number)
* RČ (Rodné číslo, the Czech birth number)
+ * IdNr (Steuerliche Identifikationsnummer, German personal tax number)
* Ust ID Nr. (Umsatzsteur Identifikationnummer, German VAT number)
* Wertpapierkennnummer (German securities identification code)
* CPR (personnummer, the Danish citizen number)
@@ -44,6 +47,7 @@ Currently this package supports the following formats:
* RUC (Registro Único de Contribuyentes, Ecuadorian company tax number)
* Isikukood (Estonian Personcal ID number)
* KMKR (Käibemaksukohuslase, Estonian VAT number)
+ * Registrikood (Estonian organisation registration code)
* CCC (Código Cuenta Corriente, Spanish Bank Account Code)
* CIF (Certificado de Identificación Fiscal, Spanish company tax number)
* CUPS (Código Unificado de Punto de Suministro, Supply Point Unified Code)
@@ -59,6 +63,7 @@ Currently this package supports the following formats:
* ALV nro (Arvonlisäveronumero, Finnish VAT number)
* Finnish Association Identifier
* HETU (Henkilötunnus, Finnish personal identity code)
+ * Veronumero (Finnish individual tax number)
* Y-tunnus (Finnish business identifier)
* NIF (Numéro d'Immatriculation Fiscale, French tax identification number)
* NIR (French personal identification number)
@@ -67,6 +72,7 @@ Currently this package supports the following formats:
* 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)
+ * UPN (English Unique Pupil Number)
* VAT (United Kingdom (and Isle of Man) VAT registration number)
* FPA, ΦΠΑ, ΑΦΜ (Αριθμός Φορολογικού Μητρώου, the Greek VAT number)
* GRid (Global Release Identifier)
diff --git a/docs/index.rst b/docs/index.rst
index 56c6fc7..dd1fbcc 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -9,7 +9,7 @@ in different formats. It contains a large collection of number formats.
Basically any number or code that has some validation mechanism available
or some common formatting is eligible for inclusion in this library.
-http://arthurdejong.org/python-stdnum/
+https://arthurdejong.org/python-stdnum/
Common Interface
@@ -100,6 +100,8 @@ Available formats
bg.vat
br.cnpj
br.cpf
+ ca.bn
+ ca.sin
ch.ssn
ch.uid
ch.vat
@@ -110,6 +112,7 @@ Available formats
cy.vat
cz.dic
cz.rc
+ de.idnr
de.vat
de.wkn
dk.cpr
@@ -121,6 +124,7 @@ Available formats
ec.ruc
ee.ik
ee.kmkr
+ ee.registrikood
es.ccc
es.cif
es.cups
@@ -136,6 +140,7 @@ Available formats
fi.alv
fi.associationid
fi.hetu
+ fi.veronumero
fi.ytunnus
fr.nif
fr.nir
@@ -144,6 +149,7 @@ Available formats
fr.tva
gb.nhs
gb.sedol
+ gb.upn
gb.vat
gr.vat
grid
diff --git a/docs/stdnum.ca.bn.rst b/docs/stdnum.ca.bn.rst
new file mode 100644
index 0000000..6979800
--- /dev/null
+++ b/docs/stdnum.ca.bn.rst
@@ -0,0 +1,5 @@
+stdnum.ca.bn
+============
+
+.. automodule:: stdnum.ca.bn
+ :members:
\ No newline at end of file
diff --git a/docs/stdnum.ca.sin.rst b/docs/stdnum.ca.sin.rst
new file mode 100644
index 0000000..b8d9e45
--- /dev/null
+++ b/docs/stdnum.ca.sin.rst
@@ -0,0 +1,5 @@
+stdnum.ca.sin
+=============
+
+.. automodule:: stdnum.ca.sin
+ :members:
\ No newline at end of file
diff --git a/docs/stdnum.de.idnr.rst b/docs/stdnum.de.idnr.rst
new file mode 100644
index 0000000..e4c148f
--- /dev/null
+++ b/docs/stdnum.de.idnr.rst
@@ -0,0 +1,5 @@
+stdnum.de.idnr
+==============
+
+.. automodule:: stdnum.de.idnr
+ :members:
\ No newline at end of file
diff --git a/docs/stdnum.ee.registrikood.rst b/docs/stdnum.ee.registrikood.rst
new file mode 100644
index 0000000..65a462a
--- /dev/null
+++ b/docs/stdnum.ee.registrikood.rst
@@ -0,0 +1,5 @@
+stdnum.ee.registrikood
+======================
+
+.. automodule:: stdnum.ee.registrikood
+ :members:
\ No newline at end of file
diff --git a/docs/stdnum.fi.veronumero.rst b/docs/stdnum.fi.veronumero.rst
new file mode 100644
index 0000000..a1fb17c
--- /dev/null
+++ b/docs/stdnum.fi.veronumero.rst
@@ -0,0 +1,5 @@
+stdnum.fi.veronumero
+====================
+
+.. automodule:: stdnum.fi.veronumero
+ :members:
\ No newline at end of file
diff --git a/docs/stdnum.gb.upn.rst b/docs/stdnum.gb.upn.rst
new file mode 100644
index 0000000..8e1c8ca
--- /dev/null
+++ b/docs/stdnum.gb.upn.rst
@@ -0,0 +1,5 @@
+stdnum.gb.upn
+=============
+
+.. automodule:: stdnum.gb.upn
+ :members:
\ No newline at end of file
diff --git a/getisbn.py b/getisbn.py
index 5755df5..6fe4cb4 100755
--- a/getisbn.py
+++ b/getisbn.py
@@ -26,6 +26,7 @@ to correctly split ISBNs into an EAN.UCC prefix, a group prefix, a registrant,
an item number and a check-digit."""
from xml.etree import ElementTree
+import ssl
import urllib.request
@@ -55,7 +56,8 @@ def get(f=None):
if f is None:
yield '# generated from RangeMessage.xml, downloaded from'
yield '# %s' % download_url
- f = urllib.request.urlopen(download_url)
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ f = urllib.request.urlopen(download_url, context=ctx)
else:
yield '# generated from %r' % f
diff --git a/online_check/README b/online_check/README
index 38841e2..8ab69e7 100644
--- a/online_check/README
+++ b/online_check/README
@@ -4,8 +4,12 @@ formats are valid for a supplied number as can be seen online at:
Configuring the WSGI application in Apache.
-# /path/to/wsgi is the directory containing the WSGI scripts
-# /path/to/html is the directory containing the static files
+- /path/to/wsgi is the directory containing the WSGI scripts
+- /path/to/html is the directory containing the static files
+
+The python-stdnum checkout is expected to be available in
+/path/to/wsgi/python-stdnum.
+
WSGIDaemonProcess stdnum threads=5 maximum-requests=100 display-name=%{GROUP}
<Directory /path/to/wsgi>
diff --git a/online_check/check.js b/online_check/check.js
index b52633f..28528f6 100644
--- a/online_check/check.js
+++ b/online_check/check.js
@@ -27,7 +27,7 @@ $( document ).ready(function() {
).replace(
/^[*] (.*)$/gm, "<ul><li>$1</li></ul>"
).replace(
- /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,
+ /(\b(https?|ftp):\/\/[^\s<]*[-\w+&@#/%=~_|])/ig,
"<a href='$1'>$1</a>"
)
}
@@ -43,6 +43,13 @@ $( document ).ready(function() {
$("<div/>").text(result["number"]).html(),
"<p>",
format(result["description"]),
+ $.map(result["conversions"], function(value, key){
+ return [
+ "<br/><b><i>",
+ $("<div/>").text(key).html(),
+ "</i></b>: ",
+ $("<div/>").text(value).html()].join('')
+ }).join(''),
"</p></li>")
});
h.push("</ul>");
@@ -93,4 +100,7 @@ $( document ).ready(function() {
// hide the submit button
$(".stdnum_hide").hide();
+ // focus the text field
+ $(".stdnum_check").focus();
+
});
diff --git a/online_check/stdnum.wsgi b/online_check/stdnum.wsgi
index c193158..a69d167 100755
--- a/online_check/stdnum.wsgi
+++ b/online_check/stdnum.wsgi
@@ -22,6 +22,7 @@ import json
import os
import re
import sys
+import inspect
sys.stdout = sys.stderr
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'python-stdnum'))
@@ -33,7 +34,24 @@ from stdnum.util import (
_template = None
+def get_conversions(module, number):
+ """Return the possible conversions for the number."""
+ for name, func in inspect.getmembers(module, inspect.isfunction):
+ if name.startswith('to_'):
+ args, varargs, varkw, defaults = inspect.getargspec(func)
+ if defaults:
+ args = args[:-len(defaults)]
+ if args == ['number']:
+ try:
+ conversion = func(number)
+ if conversion != number:
+ yield (name[3:], conversion)
+ except Exception:
+ pass
+
+
def info(module, number):
+ """Return information about the number."""
compactfn = getattr(module, 'compact', lambda x: x)
formatfn = getattr(module, 'format', compactfn)
return dict(
@@ -42,7 +60,8 @@ def info(module, number):
valid=module.is_valid(number),
module=module.__name__.split('.', 1)[1],
name=get_module_name(module),
- description=get_module_description(module))
+ description=get_module_description(module),
+ conversions=dict(get_conversions(module, number)))
def format(data):
@@ -54,6 +73,9 @@ def format(data):
r'\b((https?|ftp)://[^\s<]*[-\w+&@#/%=~_|])',
r'<a href="\1">\1</a>',
description, flags=re.IGNORECASE + re.UNICODE)
+ for name, conversion in data.get('conversions', {}).items():
+ description += '\n<br/><b><i>%s</i></b>: %s' % (
+ cgi.escape(name), cgi.escape(conversion))
return '<li><b>%s</b><br/>%s<p>%s</p></li>' % (
cgi.escape(data['name']),
cgi.escape(data['number']),
@@ -68,12 +90,11 @@ def application(environ, start_response):
environ['DOCUMENT_ROOT'],
os.path.dirname(environ['SCRIPT_NAME']).strip('/'))
_template = open(os.path.join(basedir, 'template.html'), 'r').read()
-
is_ajax = environ.get(
'HTTP_X_REQUESTED_WITH', '').lower() == 'xmlhttprequest'
-
parameters = cgi.parse_qs(environ.get('QUERY_STRING', ''))
results = []
+ number = ''
if 'number' in parameters:
number = parameters['number'][0]
results = [
@@ -84,4 +105,6 @@ def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'application/json')])
return [json.dumps(results, indent=2, sort_keys=True)]
start_response('200 OK', [('Content-Type', 'text/html')])
- return _template % '\n'.join(format(data) for data in results)
+ return _template % dict(
+ value=cgi.escape(number),
+ results='\n'.join(format(data) for data in results))
diff --git a/online_check/template.html b/online_check/template.html
index fac5cf5..63cd9ea 100644
--- a/online_check/template.html
+++ b/online_check/template.html
@@ -15,9 +15,9 @@
which it is valid.
</p>
<form>
- <input id="number" name="number" type="text" value="" class="stdnum_check" placeholder="Enter number here">
+ <input id="number" name="number" type="text" value="%(value)s" class="stdnum_check" placeholder="Enter number here">
<input type="submit" value="Check" class="stdnum_hide">
</form>
- <div id="number_results"><ul>%s</ul></div>
+ <div id="number_results"><ul>%(results)s</ul></div>
</body>
</html>
diff --git a/python_stdnum.egg-info/PKG-INFO b/python_stdnum.egg-info/PKG-INFO
index e09cbcb..f9e4652 100644
--- a/python_stdnum.egg-info/PKG-INFO
+++ b/python_stdnum.egg-info/PKG-INFO
@@ -1,8 +1,8 @@
Metadata-Version: 1.1
Name: python-stdnum
-Version: 1.6
+Version: 1.7
Summary: Python module to handle standardized numbers and codes
-Home-page: http://arthurdejong.org/python-stdnum/
+Home-page: https://arthurdejong.org/python-stdnum/
Author: Arthur de Jong
Author-email: arthur at arthurdejong.org
License: LGPL
@@ -27,6 +27,8 @@ Description: Parse, validate and reformat standard numbers and codes.
* bg.vat: VAT (Идентификационен номер по ДДС, Bulgarian VAT number)
* br.cnpj: CNPJ (Cadastro Nacional da Pessoa Jurídica, Brazillian company identifier)
* br.cpf: CPF (Cadastro de Pessoas Físicas, Brazillian national identifier)
+ * ca.bn: BN (Canadian Business Number)
+ * ca.sin: SIN (Canadian Social Insurance Number)
* ch.ssn: Swiss social security number ("Sozialversicherungsnummer")
* ch.uid: UID (Unternehmens-Identifikationsnummer, Swiss business identifier)
* ch.vat: VAT, MWST, TVA, IVA, TPV (Mehrwertsteuernummer, the Swiss VAT number)
@@ -37,6 +39,7 @@ Description: Parse, validate and reformat standard numbers and codes.
* cy.vat: Αριθμός Εγγραφής Φ.Π.Α. (Cypriot VAT number)
* cz.dic: DIČ (Daňové identifikační číslo, Czech VAT number)
* cz.rc: RČ (Rodné číslo, the Czech birth number)
+ * de.idnr: IdNr (Steuerliche Identifikationsnummer, German personal tax number)
* de.vat: Ust ID Nr. (Umsatzsteur Identifikationnummer, German VAT number)
* de.wkn: Wertpapierkennnummer (German securities identification code)
* dk.cpr: CPR (personnummer, the Danish citizen number)
@@ -48,6 +51,7 @@ Description: Parse, validate and reformat standard numbers and codes.
* ec.ruc: RUC (Registro Único de Contribuyentes, Ecuadorian company tax number)
* ee.ik: Isikukood (Estonian Personcal ID number)
* ee.kmkr: KMKR (Käibemaksukohuslase, Estonian VAT number)
+ * ee.registrikood: Registrikood (Estonian organisation registration code)
* es.ccc: CCC (Código Cuenta Corriente, Spanish Bank Account Code)
* es.cif: CIF (Certificado de Identificación Fiscal, Spanish company tax number)
* es.cups: CUPS (Código Unificado de Punto de Suministro, Supply Point Unified Code)
@@ -63,6 +67,7 @@ Description: Parse, validate and reformat standard numbers and codes.
* fi.alv: ALV nro (Arvonlisäveronumero, Finnish VAT number)
* fi.associationid: Finnish Association Identifier
* fi.hetu: HETU (Henkilötunnus, Finnish personal identity code)
+ * fi.veronumero: Veronumero (Finnish individual tax number)
* 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)
@@ -71,6 +76,7 @@ Description: Parse, validate and reformat standard numbers and codes.
* 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.upn: UPN (English Unique Pupil Number)
* gb.vat: VAT (United Kingdom (and Isle of Man) VAT registration number)
* gr.vat: FPA, ΦΠΑ, ΑΦΜ (Αριθμός Φορολογικού Μητρώου, the Greek VAT number)
* grid: GRid (Global Release Identifier)
diff --git a/python_stdnum.egg-info/SOURCES.txt b/python_stdnum.egg-info/SOURCES.txt
index 753fc74..3cae12f 100644
--- a/python_stdnum.egg-info/SOURCES.txt
+++ b/python_stdnum.egg-info/SOURCES.txt
@@ -30,6 +30,8 @@ docs/stdnum.bg.pnf.rst
docs/stdnum.bg.vat.rst
docs/stdnum.br.cnpj.rst
docs/stdnum.br.cpf.rst
+docs/stdnum.ca.bn.rst
+docs/stdnum.ca.sin.rst
docs/stdnum.ch.ssn.rst
docs/stdnum.ch.uid.rst
docs/stdnum.ch.vat.rst
@@ -41,6 +43,7 @@ docs/stdnum.cy.vat.rst
docs/stdnum.cz.dic.rst
docs/stdnum.cz.rc.rst
docs/stdnum.damm.rst
+docs/stdnum.de.idnr.rst
docs/stdnum.de.vat.rst
docs/stdnum.de.wkn.rst
docs/stdnum.dk.cpr.rst
@@ -52,6 +55,7 @@ docs/stdnum.ec.ci.rst
docs/stdnum.ec.ruc.rst
docs/stdnum.ee.ik.rst
docs/stdnum.ee.kmkr.rst
+docs/stdnum.ee.registrikood.rst
docs/stdnum.es.ccc.rst
docs/stdnum.es.cif.rst
docs/stdnum.es.cups.rst
@@ -68,6 +72,7 @@ docs/stdnum.exceptions.rst
docs/stdnum.fi.alv.rst
docs/stdnum.fi.associationid.rst
docs/stdnum.fi.hetu.rst
+docs/stdnum.fi.veronumero.rst
docs/stdnum.fi.ytunnus.rst
docs/stdnum.fr.nif.rst
docs/stdnum.fr.nir.rst
@@ -76,6 +81,7 @@ docs/stdnum.fr.siret.rst
docs/stdnum.fr.tva.rst
docs/stdnum.gb.nhs.rst
docs/stdnum.gb.sedol.rst
+docs/stdnum.gb.upn.rst
docs/stdnum.gb.vat.rst
docs/stdnum.gr.vat.rst
docs/stdnum.grid.rst
@@ -201,6 +207,9 @@ stdnum/bg/vat.py
stdnum/br/__init__.py
stdnum/br/cnpj.py
stdnum/br/cpf.py
+stdnum/ca/__init__.py
+stdnum/ca/bn.py
+stdnum/ca/sin.py
stdnum/ch/__init__.py
stdnum/ch/ssn.py
stdnum/ch/uid.py
@@ -218,6 +227,7 @@ stdnum/cz/__init__.py
stdnum/cz/dic.py
stdnum/cz/rc.py
stdnum/de/__init__.py
+stdnum/de/idnr.py
stdnum/de/vat.py
stdnum/de/wkn.py
stdnum/dk/__init__.py
@@ -232,6 +242,7 @@ stdnum/ec/ruc.py
stdnum/ee/__init__.py
stdnum/ee/ik.py
stdnum/ee/kmkr.py
+stdnum/ee/registrikood.py
stdnum/es/__init__.py
stdnum/es/ccc.py
stdnum/es/cif.py
@@ -251,6 +262,7 @@ stdnum/fi/__init__.py
stdnum/fi/alv.py
stdnum/fi/associationid.py
stdnum/fi/hetu.py
+stdnum/fi/veronumero.py
stdnum/fi/ytunnus.py
stdnum/fr/__init__.py
stdnum/fr/nif.py
@@ -261,6 +273,7 @@ stdnum/fr/tva.py
stdnum/gb/__init__.py
stdnum/gb/nhs.py
stdnum/gb/sedol.py
+stdnum/gb/upn.py
stdnum/gb/vat.py
stdnum/gr/__init__.py
stdnum/gr/vat.py
@@ -350,6 +363,7 @@ tests/test_au_acn.doctest
tests/test_au_tfn.doctest
tests/test_bg_vat.doctest
tests/test_br_cnpj.doctest
+tests/test_ca_bn.doctest
tests/test_ch_ssn.doctest
tests/test_ch_uid.doctest
tests/test_ch_vat.doctest
@@ -358,6 +372,7 @@ tests/test_cn_ric.doctest
tests/test_co_nit.doctest
... 7278 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