Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/stdnum/util.py
Commit message (Collapse)AuthorAgeFilesLines
* Minor code improvements (mostly PEP8)Arthur de Jong2017-09-111-1/+1
|
* Ensure 100% branch coverageArthur de Jong2017-08-281-12/+3
| | | | | | | | | | | 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.
* Introduce get_cc_module() utility functionArthur de Jong2016-09-101-13/+12
| | | | | | This changes the get_vat_module() function to a more generic get_cc_module() function so that it can also be used for other things like IBAN checking.
* Fix get_module_description()Arthur de Jong2016-05-281-1/+1
| | | | This fixes the initial implementation in 3f6d52a.
* Implement online TC Kimlik checkArthur de Jong2016-04-091-1/+19
| | | | | This refactors out the SOAP client function that was implemented for VIES to the stdnum.utils module.
* Code style improvementsArthur de Jong2015-10-111-12/+18
| | | | | | | Ensure that regular expressions are r'' strings, avoid too long lines and fix line wrapping. Also avoid catching toplevel Exception when possible and use binascii for hex to binary conversion which is available in both Python 2 and 3.
* Move finding VAT module to utilArthur de Jong2015-10-051-1/+20
| | | | | This moves the finding of a VAT module to the util module so that it can be more easily re-used for non-EU countries.
* Only catch ExceptionArthur de Jong2014-10-181-1/+1
|
* Add pragma: no cover for Python 3Arthur de Jong2013-12-311-1/+1
| | | | Some statements are not covered in Python 3 tests.
* Try to replace Unicode characters with ASCIIArthur de Jong2013-11-081-2/+76
| | | | | | | | | This changes the stdnum.util.clean() method that is used by all modules to replace alternative Unicode dashes, dots, etc. by their ASCII equivalent so the numbers will be automatically converted and validated. Inspiration for this change came from https://github.com/JNRowe/pyisbn/pull/6
* Use validate() in stdnum.utilArthur de Jong2013-06-081-1/+1
|
* Raise a proper exception if cleaning failsArthur de Jong2013-06-081-1/+6
|
* Revert generating stdnum docstring dynamicallyArthur de Jong2013-06-071-1/+1
| | | | | | | | | | | | | Generating the docstring dynamically results in all stdnum modules being imported for every import from any stdnum module which is a performance hit. So we switch back to a manually generated list, using: from stdnum.util import get_module_list print '\n'.join(get_module_list()) This also shortens a few short descriptions to attempt to fit things on one line.
* Use a cleaner way to get all stdnum modulesArthur de Jong2013-04-261-3/+6
| | | | This mechanism should work from Python 2.6 up to and including Python 3.3.
* generate part of the stdnum docstring based on ↵Arthur de Jong2012-09-221-0/+25
| | | | | | introspection of the modules git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@176 9dea7c4f-944c-4273-ac1a-574ede026edc
* ensure that the module docstrings are in a somewhat more ↵Arthur de Jong2012-02-261-1/+6
| | | | | | usable format git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@165 9dea7c4f-944c-4273-ac1a-574ede026edc
* use introspection to find number modules and test themArthur de Jong2012-02-191-0/+14
| | | | git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@150 9dea7c4f-944c-4273-ac1a-574ede026edc
* use the luhn module where possibleArthur de Jong2012-02-121-10/+0
| | | | git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@126 9dea7c4f-944c-4273-ac1a-574ede026edc
* implement a digitsum() function to find the sub of all ↵Arthur de Jong2012-02-111-6/+16
| | | | | | digits in a number git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@113 9dea7c4f-944c-4273-ac1a-574ede026edc
* implement a stdnum.util module for holding utility ↵Arthur de Jong2012-02-041-0/+29
functions (for now clean()) git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@100 9dea7c4f-944c-4273-ac1a-574ede026edc