lists.arthurdejong.org
RSS feed

python-stdnum branch master updated. 1.7-22-g8a34b4e

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

python-stdnum branch master updated. 1.7-22-g8a34b4e



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  8a34b4e119ed40f8cd0e66f1e75d915290ccdfb5 (commit)
       via  271b9e4192443b93d3d849851ded7190887e87ee (commit)
       via  be094f8f2f7bf2627bc3878ff50bd65b335a59e4 (commit)
      from  c576bc44aef61686eab0d8b23363da6b879cef25 (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 -----------------------------------------------------------------
https://arthurdejong.org/git/python-stdnum/commit/?id=8a34b4e119ed40f8cd0e66f1e75d915290ccdfb5

commit 8a34b4e119ed40f8cd0e66f1e75d915290ccdfb5
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sun Dec 31 17:22:59 2017 +0100

    Correctly quote regular expression
    
    Fixes a6ae1d0.

diff --git a/stdnum/util.py b/stdnum/util.py
index 58dc8d5..698a22e 100644
--- a/stdnum/util.py
+++ b/stdnum/util.py
@@ -1,7 +1,7 @@
 # util.py - common utility functions
 # coding: utf-8
 #
-# Copyright (C) 2012-2016 Arthur de Jong
+# Copyright (C) 2012-2017 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
@@ -135,7 +135,7 @@ def get_number_modules(base='stdnum'):
     module = sys.modules[base]
     # we ignore deprecation warnings from transitional modules
     with warnings.catch_warnings():
-        warnings.filterwarnings('ignore', category=DeprecationWarning, 
module='stdnum\..*')
+        warnings.filterwarnings('ignore', category=DeprecationWarning, 
module=r'stdnum\..*')
         for _loader, name, _is_pkg in pkgutil.walk_packages(
                 module.__path__, module.__name__ + '.'):
             __import__(name)

https://arthurdejong.org/git/python-stdnum/commit/?id=271b9e4192443b93d3d849851ded7190887e87ee

commit 271b9e4192443b93d3d849851ded7190887e87ee
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sun Dec 31 17:21:10 2017 +0100

    Add Sphinx documentation checks
    
    This also fixes an escaping issue in the automatically generated
    documentation for modules that end with an underscore.

diff --git a/docs/stdnum.is_.kennitala.rst b/docs/stdnum.is_.kennitala.rst
index 469c9d3..362f979 100644
--- a/docs/stdnum.is_.kennitala.rst
+++ b/docs/stdnum.is_.kennitala.rst
@@ -1,5 +1,5 @@
-stdnum.is_.kennitala
-====================
+stdnum.is\_.kennitala
+=====================
 
 .. automodule:: stdnum.is_.kennitala
    :members:
\ No newline at end of file
diff --git a/docs/stdnum.is_.vsk.rst b/docs/stdnum.is_.vsk.rst
index e917647..ba48578 100644
--- a/docs/stdnum.is_.vsk.rst
+++ b/docs/stdnum.is_.vsk.rst
@@ -1,5 +1,5 @@
-stdnum.is_.vsk
-==============
+stdnum.is\_.vsk
+===============
 
 .. automodule:: stdnum.is_.vsk
    :members:
\ No newline at end of file
diff --git a/tox.ini b/tox.ini
index 40a3f1c..df41938 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = py{26,27,34,35,36,py},flake8
+envlist = py{26,27,34,35,36,py},flake8,docs
 skip_missing_interpreters = True
 
 [testenv]
@@ -27,3 +27,8 @@ deps = flake8
        flake8-tuple
        pep8-naming
 commands = flake8 stdnum tests *.py
+
+[testenv:docs]
+basepython = python
+deps = sphinx
+commands = sphinx-build -N -b html docs {envtmpdir}/sphinx -W

https://arthurdejong.org/git/python-stdnum/commit/?id=be094f8f2f7bf2627bc3878ff50bd65b335a59e4

commit be094f8f2f7bf2627bc3878ff50bd65b335a59e4
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Wed Dec 6 21:04:49 2017 +0100

    Use README as package long description
    
    This also shortens the stdnum module docstring and updates the Sphinx
    configuration.

diff --git a/README b/README
index 08dec83..e15ceb5 100644
--- a/README
+++ b/README
@@ -2,7 +2,13 @@ python-stdnum
 =============
 
 A Python module to parse, validate and reformat standard numbers and codes
-in different formats.
+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.
+
+https://arthurdejong.org/python-stdnum/
+
 
 Available formats
 -----------------
@@ -152,17 +158,29 @@ and use of the specified numbers, only parsing and 
handling functions.
 Interface
 ---------
 
+All modules implement a common interface. For example for ISBN validation:
+
+    >>> from stdnum import isbn
+    >>> isbn.validate('978-9024538270')
+    '9789024538270'
+    >>> isbn.validate('978-9024538271')
+    Traceback (most recent call last):
+        ...
+    InvalidChecksum: ...
+
 Most of these modules implement the following functions:
 
-validate() - validate the correctness of the passed number and return a
-             compact representation of the number
-             invalid numbers are rejected with one of the exceptions
-             from the stdnum.exceptions module
-compact() - return a compact representation of the number or code
-            this function generally does not do validation but may raise
-            exceptions for wildly incorrect numbers
-format() - return a formatted version of the number in the preferred format
-           this function generally expects to be passed a valid number or code
+ * `validate()`
+    validate the correctness of the passed number and return a compact
+    representation of the number invalid numbers are rejected with one of the
+    exceptions from the stdnum.exceptions module
+ * `compact()`
+   return a compact representation of the number or code this function
+   generally does not do validation but may raise exceptions for wildly
+   incorrect numbers
+ * `format()`
+   return a formatted version of the number in the preferred format this
+   function generally expects to be passed a valid number or code
 
 Apart from the above, the module may add extra parsing, validation or
 conversion functions.
diff --git a/docs/conf.py b/docs/conf.py
index 27938fd..38ac5f7 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -46,7 +46,7 @@ master_doc = 'index'
 
 # General information about the project.
 project = u'python-stdnum'
-copyright = u'2013, Arthur de Jong'
+copyright = u'2013-2017, Arthur de Jong'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
@@ -69,7 +69,7 @@ release = version
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
-exclude_patterns = ['_*', '.svn']
+exclude_patterns = ['_*', '.svn', '.git']
 
 # The reST default role (used for this markup: `text`) to use for all 
documents.
 #default_role = None
@@ -132,7 +132,7 @@ html_theme = 'default'
 
 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
 # using the given strftime format.
-html_last_updated_fmt = '%b %d, %Y'
+html_last_updated_fmt = '%Y-%m-%d'
 
 # If true, SmartyPants will be used to convert quotes and dashes to
 # typographically correct entities.
@@ -189,3 +189,5 @@ man_pages = [
 
 # If true, show URL addresses after external links.
 #man_show_urls = False
+
+intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
diff --git a/docs/index.rst b/docs/index.rst
index 822c6d2..2ae70b2 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,15 +1,7 @@
 .. module:: stdnum
 
-python-stdnum
-=============
-
-A Python module to parse, validate and reformat standard numbers and codes
-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.
-
-https://arthurdejong.org/python-stdnum/
+.. include:: ../README
+   :end-before: Available formats
 
 
 Common Interface
@@ -26,8 +18,8 @@ Most of the number format modules implement the following 
functions:
 
 .. function:: is_valid(number)
 
-   Return either True or False depending on whether the passed number is
-   in any supported and valid form and passes all embedded checks of the
+   Return either ``True`` or ``False`` depending on whether the passed number
+   is in any supported and valid form and passes all embedded checks of the
    number. This function should never raise an exception.
 
 .. function:: compact(number)
diff --git a/getnumlist.py b/getnumlist.py
index c8b9b4d..47cd4a0 100755
--- a/getnumlist.py
+++ b/getnumlist.py
@@ -2,7 +2,7 @@
 
 # getnumlist.py - script to get a list of number formats in stdnum
 #
-# Copyright (C) 2012-2016 Arthur de Jong
+# Copyright (C) 2012-2017 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
@@ -45,14 +45,6 @@ if __name__ == '__main__':
     for module in get_number_modules():
         print ' * %s' % util.get_module_name(module)
     print ''
-    print 'For stdnum/__init__.py:'
-    print ''
-    for module in get_number_modules():
-        print '* %s: %s' % (
-            module.__name__.replace('stdnum.', ''),
-            util.get_module_name(module),
-        )
-    print ''
     print 'For docs/index.rst:'
     print ''
     for module in get_number_modules():
diff --git a/setup.py b/setup.py
index de67e5b..c47808e 100755
--- a/setup.py
+++ b/setup.py
@@ -32,10 +32,15 @@ if 'sdist' in sys.argv:
     os.system('chmod -R a+rX .')
     os.umask(int('022', 8))
 
+base_dir = os.path.dirname(__file__)
+
+with open(os.path.join(base_dir, 'README'), 'r') as fp:
+    long_description = fp.read()
+
 setup(name='python-stdnum',
       version=stdnum.__version__,
       description='Python module to handle standardized numbers and codes',
-      long_description=stdnum.__doc__,
+      long_description=long_description,
       author='Arthur de Jong',
       author_email='arthur@arthurdejong.org',
       url='https://arthurdejong.org/python-stdnum/',
diff --git a/stdnum/__init__.py b/stdnum/__init__.py
index cbca925..e915184 100644
--- a/stdnum/__init__.py
+++ b/stdnum/__init__.py
@@ -23,145 +23,6 @@
 This library offers functions for parsing, validating and reformatting
 standard numbers and codes in various formats.
 
-Currently this package supports the following formats:
-
-* al.nipt: NIPT (Numri i Identifikimit për Personin e Tatueshëm, Albanian VAT 
number)
-* ar.cbu: CBU (Clave Bancaria Uniforme, Argentine bank account number)
-* ar.cuit: CUIT (Código Único de Identificación Tributaria, Argentinian tax 
number)
-* at.businessid: Austrian Company Register Numbers
-* at.uid: UID (Umsatzsteuer-Identifikationsnummer, Austrian VAT number)
-* au.abn: ABN (Australian Business Number)
-* au.acn: ACN (Australian Company Number)
-* au.tfn: TFN (Australian Tax File Number)
-* be.vat: BTW, TVA, NWSt, ondernemingsnummer (Belgian enterprise number)
-* bg.egn: EGN (ЕГН, Единен граждански номер, Bulgarian personal identity codes)
-* bg.pnf: PNF (ЛНЧ, Личен номер на чужденец, Bulgarian number of a foreigner)
-* 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)
-* cl.rut: RUT (Rol Único Tributario, Chilean national tax number)
-* cn.ric: RIC No. (Chinese Resident Identity Card Number)
-* co.nit: NIT (Número De Identificación Tributaria, Colombian identity code)
-* cusip: CUSIP number (financial security identification number)
-* 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)
-* dk.cvr: CVR (Momsregistreringsnummer, Danish VAT number)
-* do.cedula: Cedula (Dominican Republic national identification number)
-* do.rnc: RNC (Registro Nacional del Contribuyente, Dominican Republic tax 
number)
-* ean: EAN (International Article Number)
-* ec.ci: CI (Cédula de identidad, Ecuadorian personal identity code)
-* 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)
-* es.dni: DNI (Documento nacional de identidad, Spanish personal identity 
codes)
-* es.iban: Spanish IBAN (International Bank Account Number)
-* 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)
-* es.referenciacatastral: Referencia Catastral (Spanish real estate property 
id)
-* eu.at_02: SEPA Identifier of the Creditor (AT-02)
-* eu.eic: EIC (European Energy Identification Code)
-* eu.nace: NACE (classification for businesses in the European Union)
-* eu.vat: VAT (European Union VAT number)
-* 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)
-* 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.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)
-* 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 tax reference number)
-* imei: IMEI (International Mobile Equipment Identity)
-* imo: IMO number (International Maritime Organization number)
-* imsi: IMSI (International Mobile Subscriber Identity)
-* is_.kennitala: Kennitala (Icelandic personal and organisation identity code)
-* is_.vsk: VSK number (Virðisaukaskattsnúmer, Icelandic VAT number)
-* isan: ISAN (International Standard Audiovisual Number)
-* isbn: ISBN (International Standard Book Number)
-* isil: ISIL (International Standard Identifier for Libraries)
-* isin: ISIN (International Securities Identification Number)
-* ismn: ISMN (International Standard Music Number)
-* iso6346: ISO 6346 (International standard for container identification)
-* iso9362: ISO 9362 (Business identifier codes)
-* issn: ISSN (International Standard Serial Number)
-* it.codicefiscale: Codice Fiscale (Italian tax code for individuals)
-* it.iva: Partita IVA (Italian VAT number)
-* lei: LEI (Legal Entity Identifier)
-* 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)
-* mc.tva: n° TVA (taxe sur la valeur ajoutée, Monacan VAT number)
-* meid: MEID (Mobile Equipment Identifier)
-* mt.vat: VAT (Maltese VAT number)
-* mx.rfc: RFC (Registro Federal de Contribuyentes, Mexican tax 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)
-* no.mva: MVA (Merverdiavgift, Norwegian VAT number)
-* no.orgnr: Orgnr (Organisasjonsnummer, Norwegian organisation number)
-* pl.nip: NIP (Numer Identyfikacji Podatkowej, Polish VAT number)
-* pl.pesel: PESEL (Polish national identification number)
-* pl.regon: REGON (Rejestr Gospodarki Narodowej, Polish register of economic 
units)
-* 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)
-* rs.pib: PIB (Poreski Identifikacioni Broj, Serbian tax identification number)
-* ru.inn: ИНН (Идентификационный номер налогоплательщика, Russian tax 
identifier)
-* se.orgnr: Orgnr (Organisationsnummer, Swedish company number)
-* 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)
-* 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)
-* us.ptin: PTIN (U.S. Preparer Tax Identification Number)
-* us.rtn: RTN (Routing transport 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:
-
-* 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
-* 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

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

Summary of changes:
 README                        |  38 +++++++++---
 docs/conf.py                  |   8 ++-
 docs/index.rst                |  16 ++---
 docs/stdnum.is_.kennitala.rst |   4 +-
 docs/stdnum.is_.vsk.rst       |   4 +-
 getnumlist.py                 |  10 +--
 setup.py                      |   7 ++-
 stdnum/__init__.py            | 139 ------------------------------------------
 stdnum/util.py                |   4 +-
 tox.ini                       |   7 ++-
 10 files changed, 56 insertions(+), 181 deletions(-)


hooks/post-receive
-- 
python-stdnum
-- 
To unsubscribe send an email to
python-stdnum-commits-unsubscribe@lists.arthurdejong.org or see
https://lists.arthurdejong.org/python-stdnum-commits/