lists.arthurdejong.org
RSS feed

python-stdnum branch master updated. 0.9-10-gfbb0316

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

python-stdnum branch master updated. 0.9-10-gfbb0316



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  fbb03161eec04454431dc4e3099b6d1a3706edcc (commit)
       via  03e4f9738080b87a7d6bc4ba32dae07de4c51c1f (commit)
       via  26517feef401b58b5c9fcbef828f23a1286b988a (commit)
      from  85dd6f26be85f33986c2cd25c5a10cfdf4a5306c (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=fbb03161eec04454431dc4e3099b6d1a3706edcc

commit fbb03161eec04454431dc4e3099b6d1a3706edcc
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sat Jul 5 22:38:07 2014 +0200

    Use ElementTree for simpler XML parsing

diff --git a/getisbn.py b/getisbn.py
index 49f7c0c..5377565 100755
--- a/getisbn.py
+++ b/getisbn.py
@@ -25,17 +25,24 @@ ranges for those prefixes suitable for the numdb module. 
This data is needed
 to correctly split ISBNs into an EAN.UCC prefix, a group prefix, a registrant,
 an item number and a check-digit."""
 
-import xml.sax
+from xml.etree import ElementTree
 import urllib
 
 
-# The place where the current version of RangeMessage.xml can be downloaded.
+# the location of the ISBN Ranges XML file
 download_url = 'https://www.isbn-international.org/export_rangemessage.xml'
 
 
-def _wrap(text):
-    """Generator that returns lines of text that are no longer than
-    max_len."""
+def ranges(group):
+    for rule in group.find('Rules').findall('Rule'):
+        length = int(rule.find('Length').text.strip())
+        if length:
+            yield '-'.join(
+                x[:length]
+                for x in rule.find('Range').text.strip().split('-'))
+
+
+def wrap(text):
     while text:
         i = len(text)
         if i > 73:
@@ -44,66 +51,40 @@ def _wrap(text):
         text = text[i + 1:]
 
 
-class RangeHandler(xml.sax.ContentHandler):
-
-    def __init__(self):
-        self._gather = None
-        self._prefix = None
-        self._agency = None
-        self._range = None
-        self._length = None
-        self._ranges = []
-        self._last = None
-        self._topranges = {}
-
-    def startElement(self, name, attrs):
-        if name in ('MessageSerialNumber', 'MessageDate', 'Prefix',
-                    'Agency', 'Range', 'Length'):
-            self._gather = ''
-
-    def characters(self, content):
-        if self._gather is not None:
-            self._gather += content
-
-    def endElement(self, name):
-        if name == 'MessageSerialNumber':
-            print '# file serial %s' % self._gather.strip()
-        elif name == 'MessageDate':
-            print '# file date %s' % self._gather.strip()
-        elif name == 'Prefix':
-            self._prefix = self._gather.strip()
-        elif name == 'Agency':
-            self._agency = self._gather.strip()
-        elif name == 'Range':
-            self._range = self._gather.strip()
-        elif name == 'Length':
-            self._length = int(self._gather.strip())
-        elif name == 'Rule' and self._length:
-            self._ranges.append(tuple(x[:self._length]
-                                      for x in self._range.split('-')))
-        elif name == 'Rules':
-            if '-' in self._prefix:
-                p, a = self._prefix.split('-')
-                if p != self._last:
-                    print p
-                    self._last = p
-                    for line in _wrap(','.join(r[0] + '-' + r[1]
-                                               for r in self._topranges[p])):
-                        print ' %s' % line
-                print (' %s agency="%s"' % (a, self._agency)).encode('utf-8')
-                for line in _wrap(','.join(r[0] + '-' + r[1]
-                                           for r in self._ranges)):
-                    print '  %s' % line
-            else:
-                self._topranges[self._prefix] = self._ranges
-            self._ranges = []
-        self._gather = None
+def get(f=None):
+    if f is None:
+        yield '# generated from RangeMessage.xml, downloaded from'
+        yield '# %s' % download_url
+        f = urllib.urlopen(download_url)
+    else:
+        yield '# generated from %r' % f
+
+    # parse XML document
+    msg = ElementTree.parse(f).getroot()
+
+    # dump data from document
+    yield '# file serial %s' % msg.find('MessageSerialNumber').text.strip()
+    yield '# file date %s' % msg.find('MessageDate').text.strip()
+
+    top_groups = dict(
+        (x.find('Prefix').text.strip(), x)
+        for x in msg.find('EAN.UCCPrefixes').findall('EAN.UCC'))
+
+    prevtop = None
+    for group in msg.find('RegistrationGroups').findall('Group'):
+        top, prefix = group.find('Prefix').text.strip().split('-')
+        agency = group.find('Agency').text.strip()
+        if top != prevtop:
+            yield top
+            for line in wrap(','.join(ranges(top_groups[top]))):
+                yield ' %s' % line
+            prevtop = top
+        yield ' %s agency="%s"' % (prefix, agency)
+        for line in wrap(','.join(ranges(group))):
+            yield '  %s' % line
 
 
 if __name__ == '__main__':
-    print '# generated from RangeMessage.xml, downloaded from'
-    print '# %s' % download_url
-    parser = xml.sax.make_parser()
-    parser.setContentHandler(RangeHandler())
-    parser.parse(urllib.urlopen(download_url))
-    #parser.parse('RangeMessage.xml')
+    # get('RangeMessage.xml')
+    for row in get():
+        print row.encode('utf-8')

http://arthurdejong.org/git/python-stdnum/commit/?id=03e4f9738080b87a7d6bc4ba32dae07de4c51c1f

commit 03e4f9738080b87a7d6bc4ba32dae07de4c51c1f
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sat Jul 5 22:15:24 2014 +0200

    Fix getisbn script and update ISBN data file

diff --git a/getisbn.py b/getisbn.py
index a184bdd..49f7c0c 100755
--- a/getisbn.py
+++ b/getisbn.py
@@ -2,7 +2,7 @@
 
 # getisbn.py - script to get ISBN prefix data
 #
-# Copyright (C) 2010, 2011 Arthur de Jong
+# Copyright (C) 2010, 2011, 2014 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
@@ -30,7 +30,7 @@ import urllib
 
 
 # The place where the current version of RangeMessage.xml can be downloaded.
-download_url = 'http://www.isbn-international.org/agency?rmxml=1'
+download_url = 'https://www.isbn-international.org/export_rangemessage.xml'
 
 
 def _wrap(text):
@@ -90,7 +90,7 @@ class RangeHandler(xml.sax.ContentHandler):
                     for line in _wrap(','.join(r[0] + '-' + r[1]
                                                for r in self._topranges[p])):
                         print ' %s' % line
-                print ' %s agency="%s"' % (a, self._agency)
+                print (' %s agency="%s"' % (a, self._agency)).encode('utf-8')
                 for line in _wrap(','.join(r[0] + '-' + r[1]
                                            for r in self._ranges)):
                     print '  %s' % line
diff --git a/stdnum/isbn.dat b/stdnum/isbn.dat
index 38b7792..d46d6dd 100644
--- a/stdnum/isbn.dat
+++ b/stdnum/isbn.dat
@@ -1,13 +1,14 @@
 # generated from RangeMessage.xml, downloaded from
-# http://www.isbn-international.org/agency?rmxml=1
-# file serial be2e8e46-b368-41c0-8603-5938a5e7e0f7
-# file date Mon, 25 Nov 2013 09:51:28 GMT
+# https://www.isbn-international.org/export_rangemessage.xml
+# file serial 95adc47f-d968-4bd9-bee6-5aa3a54017e6
+# file date Thu, 19 Jun 2014 16:00:12 CEST
 978
  0-5,600-649,7-7,80-94,950-989,9900-9989,99900-99999
  0 agency="English language"
   00-19,200-699,7000-8499,85000-89999,900000-949999,9500000-9999999
  1 agency="English language"
-  00-09,100-399,4000-5499,55000-86979,869800-998999,9990000-9999999
+  00-09,100-327,328-329,330-399,4000-5499,55000-86979,869800-998999
+  9990000-9999999
  2 agency="French language"
   00-19,200-349,35000-39999,400-699,7000-8399,84000-89999,900000-949999
   9500000-9999999
@@ -17,7 +18,7 @@
   99500-99999
  4 agency="Japan"
   00-19,200-699,7000-8499,85000-89999,900000-949999,9500000-9999999
- 5 agency="Russian Federation and former USSR"
+ 5 agency="former U.S.S.R"
   00000-00499,0050-0099,01-19,200-420,4210-4299,430-430,4310-4399,440-440
   4410-4499,450-699,7000-8499,85000-89999,900000-909999,91000-91999
   9200-9299,93000-94999,9500000-9500999,9501-9799,98000-98999
@@ -28,13 +29,13 @@
   00-19,200-699,7000-7999,80000-84999,85-99
  602 agency="Indonesia"
   00-10,1100-1199,1200-1399,14000-14999,1500-1699,17000-17999,18000-18999
-  19000-19999,200-749,7500-7999,8000-9499,95000-99999
+  19000-19999,200-699,70000-74999,7500-7999,8000-9499,95000-99999
  603 agency="Saudi Arabia"
   00-04,05-49,500-799,8000-8999,90000-99999
  604 agency="Vietnam"
   0-4,50-89,900-979,9800-9999
  605 agency="Turkey"
-  01-09,100-399,4000-5999,60000-89999,90-99
+  01-09,100-399,4000-5999,60000-89999,9000-9999
  606 agency="Romania"
   0-0,10-49,500-799,8000-9199,92000-99999
  607 agency="Mexico"
@@ -66,12 +67,12 @@
   00-29,400-599,8000-8999,95000-99999
  7 agency="China, People's Republic"
   00-09,100-499,5000-7999,80000-89999,900000-999999
- 80 agency="Czech Republic and Slovakia"
+ 80 agency="former Czechoslovakia"
   00-19,200-699,7000-8499,85000-89999,900000-999999
  81 agency="India"
   00-19,200-699,7000-8499,85000-89999,900000-999999
  82 agency="Norway"
-  00-19,200-699,7000-8999,90000-98999,990000-999999
+  00-19,200-689,690000-699999,7000-8999,90000-98999,990000-999999
  83 agency="Poland"
   00-19,200-599,60000-69999,7000-8499,85000-89999,900000-999999
  84 agency="Spain"
@@ -79,7 +80,7 @@
   920000-923999,92400-92999,930000-949999,95000-96999,9700-9999
  85 agency="Brazil"
   00-19,200-599,60000-69999,7000-8499,85000-89999,900000-979999,98000-99999
- 86 agency="Serbia (shared)"
+ 86 agency="former Yugoslavia"
   00-29,300-599,6000-7999,80000-89999,900000-999999
  87 agency="Denmark"
   00-29,400-649,7000-7999,85000-94999,970000-999999
@@ -110,8 +111,8 @@
  954 agency="Bulgaria"
   00-28,2900-2999,300-799,8000-8999,90000-92999,9300-9999
  955 agency="Sri Lanka"
-  0000-1999,20-40,41000-43999,44000-44999,4500-4999,50000-54999,550-799
-  8000-9499,95000-99999
+  0000-1999,20-40,41000-43999,44000-44999,4500-4999,50000-54999,550-749
+  7500-7999,8000-9499,95000-99999
  956 agency="Chile"
   00-19,200-699,7000-9999
  957 agency="Taiwan"
@@ -143,7 +144,7 @@
  968 agency="Mexico"
   01-39,400-499,5000-7999,800-899,9000-9999
  969 agency="Pakistan"
-  0-1,20-39,400-799,8000-9999
+  0-1,20-22,23000-23999,24-39,400-749,7500-9999
  970 agency="Mexico"
   01-59,600-899,9000-9099,91000-96999,9700-9999
  971 agency="Philippines"
@@ -189,6 +190,8 @@
   00-11,12000-14999,15000-16999,17000-19999,200-799,8000-9699,97000-99999
  989 agency="Portugal"
   0-1,20-54,550-799,8000-9499,95000-99999
+ 9926 agency="Bosnia and Herzegovina"
+  0-1,20-39,400-799,8000-9999
  9927 agency="Qatar"
   00-09,100-399,4000-4999
  9928 agency="Albania"
@@ -252,7 +255,8 @@
  9957 agency="Jordan"
   00-39,400-699,70-84,8500-8799,88-99
  9958 agency="Bosnia and Herzegovina"
-  00-03,040-089,0900-0999,10-18,1900-1999,20-49,500-899,9000-9999
+  00-01,020-029,0300-0399,040-089,0900-0999,10-18,1900-1999,20-49,500-899
+  9000-9999
  9959 agency="Libya"
   0-1,20-79,800-949,9500-9699,970-979,98-99
  9960 agency="Saudi Arabia"
@@ -318,7 +322,7 @@
  99902 agency="Gabon (reserved)"
  99903 agency="Mauritius"
   0-1,20-89,900-999
- 99904 agency="Netherlands Antilles and Aruba"
+ 99904 agency="Curaçao"
   0-5,60-89,900-999
  99905 agency="Bolivia"
   0-3,40-79,800-999
@@ -459,9 +463,13 @@
   40-79,800-999
  99975 agency="Tajikistan"
   0-3,40-79,800-999
+ 99976 agency="Srpska, Republic of"
+  0-1,20-59,600-799
 979
- 10-11
+ 10-12
  10 agency="France"
   00-19,200-699,7000-8999,90000-97599,976000-999999
  11 agency="Korea, Republic"
   00-24,250-549,5500-8499,85000-94999,950000-999999
+ 12 agency="Italy"
+  200-200

http://arthurdejong.org/git/python-stdnum/commit/?id=26517feef401b58b5c9fcbef828f23a1286b988a

commit 26517feef401b58b5c9fcbef828f23a1286b988a
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Fri Apr 11 20:10:35 2014 +0200

    Improve package docstring formatting and show example

diff --git a/getnumlist.py b/getnumlist.py
index c666c4b..97c91bc 100755
--- a/getnumlist.py
+++ b/getnumlist.py
@@ -47,7 +47,7 @@ if __name__ == '__main__':
     print 'For stdnum/__init__.py:'
     print ''
     for module in get_number_modules():
-        print ' * %s: %s' % (
+        print '* %s: %s' % (
             module.__name__.replace('stdnum.', ''),
             util.get_module_name(module),
         )
diff --git a/stdnum/__init__.py b/stdnum/__init__.py
index b11e4fc..815f6bd 100644
--- a/stdnum/__init__.py
+++ b/stdnum/__init__.py
@@ -25,80 +25,93 @@ standard numbers and codes in various formats.
 
 Currently this package supports the following formats:
 
- * at.uid: UID (Umsatzsteuer-Identifikationsnummer, Austrian VAT number)
- * be.vat: BTW, TVA, NWSt (Belgian VAT number)
- * bg.egn: EGN (ЕГН, Единен граждански номер, Bulgarian personal identity 
codes)
- * bg.pnf: PNF (ЛНЧ, Личен номер на чужденец, Bulgarian number of a foreigner)
- * bg.vat: VAT (Идентификационен номер по ДДС, Bulgarian VAT number)
- * br.cpf: CPF (Cadastro de Pessoas Físicas, Brazillian national identifier)
- * 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.vat: Ust ID Nr. (Umsatzsteur Identifikationnummer, German VAT number)
- * dk.cpr: CPR (personnummer, the Danish citizen number)
- * dk.cvr: CVR (Momsregistreringsnummer, Danish VAT number)
- * ean: EAN (International Article Number)
- * ee.kmkr: KMKR (Käibemaksukohuslase, Estonian VAT number)
- * es.cif: CIF (Certificado de Identificación Fiscal, Spanish company tax 
number)
- * es.dni: DNI (Documento nacional de identidad, Spanish personal identity 
codes)
- * es.nie: NIE (Número de Identificación de Extranjeros, Spanish foreigner 
number)
- * es.nif: NIF (Número de Identificación Fiscal, Spanish VAT number)
- * eu.vat: VAT (European Union VAT number)
- * fi.alv: ALV nro (Arvonlisäveronumero, Finnish VAT number)
- * fi.hetu: HETU (Henkilötunnus, Finnish personal identity code)
- * fr.siren: SIREN (a French company identification number)
- * fr.tva: n° TVA (taxe sur la valeur ajoutée, French VAT number)
- * gb.vat: VAT (United Kingdom (and Isle of Man) VAT registration number)
- * gr.vat: FPA, ΦΠΑ (Foros Prostithemenis Aksias, the Greek VAT number)
- * grid: GRid (Global Release Identifier)
- * hr.oib: OIB (Osobni identifikacijski broj, Croatian identification number)
- * 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)
- * imei: IMEI (International Mobile Equipment Identity)
- * imsi: IMSI (International Mobile Subscriber Identity)
- * isan: ISAN (International Standard Audiovisual Number)
- * isbn: ISBN (International Standard Book Number)
- * isil: ISIL (International Standard Identifier for Libraries)
- * ismn: ISMN (International Standard Music Number)
- * issn: ISSN (International Standard Serial Number)
- * it.iva: Partita IVA (Italian VAT number)
- * lt.pvm: PVM (Pridėtinės vertės mokestis mokėtojo kodas, Lithuanian VAT 
number)
- * lu.tva: TVA (taxe sur la valeur ajoutée, Luxembourgian VAT number)
- * lv.pvn: PVN (Pievienotās vērtības nodokļa, Latvian VAT number)
- * meid: MEID (Mobile Equipment Identifier)
- * mt.vat: VAT (Maltese VAT number)
- * my.nric: NRIC No. (Malaysian National Registration Identity Card Number)
- * nl.brin: Brin number (Dutch number for schools)
- * nl.bsn: BSN (Burgerservicenummer, Dutch national identification number)
- * nl.btw: BTW-nummer (Omzetbelastingnummer, the Dutch VAT number)
- * nl.onderwijsnummer: Onderwijsnummer (Dutch student school number)
- * nl.postcode: Postcode (Dutch postal code)
- * pl.nip: NIP (Numer Identyfikacji Podatkowej, Polish VAT number)
- * pt.nif: NIF (Número de identificação fiscal, Portuguese VAT number)
- * ro.cf: CF (Cod de înregistrare în scopuri de TVA, Romanian VAT number)
- * ro.cnp: CNP (Cod Numeric Personal, Romanian Numerical Personal Code)
- * se.vat: VAT (Moms, Mervärdesskatt, Swedish VAT number)
- * si.ddv: ID za DDV (Davčna številka, Slovenian VAT number)
- * sk.dph: IČ DPH (IČ pre daň z pridanej hodnoty, Slovak VAT number)
- * sk.rc: RČ (Rodné číslo, the Slovak birth 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)
- * us.ptin: PTIN (U.S. Preparer Tax Identification Number)
- * us.ssn: SSN (U.S. Social Security Number)
- * us.tin: TIN (U.S. Taxpayer Identification Number)
+* at.uid: UID (Umsatzsteuer-Identifikationsnummer, Austrian VAT number)
+* be.vat: BTW, TVA, NWSt (Belgian VAT number)
+* bg.egn: EGN (ЕГН, Единен граждански номер, Bulgarian personal identity codes)
+* bg.pnf: PNF (ЛНЧ, Личен номер на чужденец, Bulgarian number of a foreigner)
+* bg.vat: VAT (Идентификационен номер по ДДС, Bulgarian VAT number)
+* br.cpf: CPF (Cadastro de Pessoas Físicas, Brazillian national identifier)
+* 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.vat: Ust ID Nr. (Umsatzsteur Identifikationnummer, German VAT number)
+* dk.cpr: CPR (personnummer, the Danish citizen number)
+* dk.cvr: CVR (Momsregistreringsnummer, Danish VAT number)
+* ean: EAN (International Article Number)
+* ee.kmkr: KMKR (Käibemaksukohuslase, Estonian VAT number)
+* es.cif: CIF (Certificado de Identificación Fiscal, Spanish company tax 
number)
+* es.dni: DNI (Documento nacional de identidad, Spanish personal identity 
codes)
+* es.nie: NIE (Número de Identificación de Extranjeros, Spanish foreigner 
number)
+* es.nif: NIF (Número de Identificación Fiscal, Spanish VAT number)
+* eu.vat: VAT (European Union VAT number)
+* fi.alv: ALV nro (Arvonlisäveronumero, Finnish VAT number)
+* fi.hetu: HETU (Henkilötunnus, Finnish personal identity code)
+* fr.siren: SIREN (a French company identification number)
+* fr.tva: n° TVA (taxe sur la valeur ajoutée, French VAT number)
+* gb.vat: VAT (United Kingdom (and Isle of Man) VAT registration number)
+* gr.vat: FPA, ΦΠΑ (Foros Prostithemenis Aksias, the Greek VAT number)
+* grid: GRid (Global Release Identifier)
+* hr.oib: OIB (Osobni identifikacijski broj, Croatian identification number)
+* 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)
+* imei: IMEI (International Mobile Equipment Identity)
+* imsi: IMSI (International Mobile Subscriber Identity)
+* isan: ISAN (International Standard Audiovisual Number)
+* isbn: ISBN (International Standard Book Number)
+* isil: ISIL (International Standard Identifier for Libraries)
+* ismn: ISMN (International Standard Music Number)
+* issn: ISSN (International Standard Serial Number)
+* it.iva: Partita IVA (Italian VAT number)
+* lt.pvm: PVM (Pridėtinės vertės mokestis mokėtojo kodas, Lithuanian VAT 
number)
+* lu.tva: TVA (taxe sur la valeur ajoutée, Luxembourgian VAT number)
+* lv.pvn: PVN (Pievienotās vērtības nodokļa, Latvian VAT number)
+* meid: MEID (Mobile Equipment Identifier)
+* mt.vat: VAT (Maltese VAT number)
+* my.nric: NRIC No. (Malaysian National Registration Identity Card Number)
+* nl.brin: Brin number (Dutch number for schools)
+* nl.bsn: BSN (Burgerservicenummer, Dutch national identification number)
+* nl.btw: BTW-nummer (Omzetbelastingnummer, the Dutch VAT number)
+* nl.onderwijsnummer: Onderwijsnummer (Dutch student school number)
+* nl.postcode: Postcode (Dutch postal code)
+* pl.nip: NIP (Numer Identyfikacji Podatkowej, Polish VAT number)
+* pt.nif: NIF (Número de identificação fiscal, Portuguese VAT number)
+* ro.cf: CF (Cod de înregistrare în scopuri de TVA, Romanian VAT number)
+* ro.cnp: CNP (Cod Numeric Personal, Romanian Numerical Personal Code)
+* se.vat: VAT (Moms, Mervärdesskatt, Swedish VAT number)
+* si.ddv: ID za DDV (Davčna številka, Slovenian VAT number)
+* sk.dph: IČ DPH (IČ pre daň z pridanej hodnoty, Slovak VAT number)
+* sk.rc: RČ (Rodné číslo, the Slovak birth 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)
+* us.ptin: PTIN (U.S. Preparer Tax Identification Number)
+* us.ssn: SSN (U.S. Social Security Number)
+* us.tin: TIN (U.S. Taxpayer Identification Number)
 
 Furthermore a number of generic check digit algorithms are available:
 
- * 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
- * iso7064.mod_37_36: The ISO 7064 Mod 37, 36 algorithm
- * iso7064.mod_97_10: The ISO 7064 Mod 97, 10 algorithm
- * luhn: The Luhn and Luhn mod N algorithms
- * verhoeff: The Verhoeff 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
+* iso7064.mod_37_36: The ISO 7064 Mod 37, 36 algorithm
+* iso7064.mod_97_10: The ISO 7064 Mod 97, 10 algorithm
+* luhn: The Luhn and Luhn mod N algorithms
+* verhoeff: The Verhoeff algorithm
+
+All modules implement a common interface:
+
+>>> from stdnum import isbn
+>>> isbn.validate('978-9024538270')
+'9789024538270'
+>>> isbn.validate('978-9024538271')
+Traceback (most recent call last):
+    ...
+InvalidChecksum: ...
+
+Apart from the validate() function, modules generally provide extra
+parsing, validation, formatting or conversion functions.
 """
 
 

-----------------------------------------------------------------------

Summary of changes:
 getisbn.py         |  115 ++++++++++++++++----------------------
 getnumlist.py      |    2 +-
 stdnum/__init__.py |  155 ++++++++++++++++++++++++++++------------------------
 stdnum/isbn.dat    |   40 ++++++++------
 4 files changed, 157 insertions(+), 155 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/