Homepage of Arthur de Jong

This is a Python library that aims to provide functions to handle, parse and validate standard numbers.

The module supports a wide range of number formats amongst which a great number of VAT and other tax numbers, personal identity and company identification codes, international standard numbers (ISBN, IBAN, EAN, etc.) and various other formats.
The module also inclused implementations of the Verhoeff, Luhn and family of ISO/IEC 7064 check digit algorithms.

The following validates and formats an ISBN:

>>> from stdnum import isbn
>>> isbn.validate('978-9024538270')
'9789024538270'
>>> isbn.validate('978-9024538271')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> isbn.format('9780471117094')
'978-0-471-11709-4'

Feedback and support for more numbers is more than welcome. Please use the python-stdnum-users mailing list.

Download

Trac instance

A trac instance has been set up. Users are encouraged to request new formats by creating a ticket or contributing to the wiki.

Git repository

The python-stdnum development repository is also available through Git with:

git clone http://arthurdejong.org/git/python-stdnum

The repository is browsable and also cloned on Github and Gitorious.

Copyright Notice

Copyright © 2010-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 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.

A copy of the GNU Lesser General Public License is available in the download and can be found on the World Wide Web at http://www.gnu.org/licenses/lgpl.html. You can also obtain it by writing to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.