Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/stdnum/numdb.py
Commit message (Collapse)AuthorAgeFilesLines
* Use importlib.resource in place of deprecated pkg_resourcesArthur de Jong2023-08-201-4/+12
| | | | | Closes https://github.com/arthurdejong/python-stdnum/issues/412 Closes https://github.com/arthurdejong/python-stdnum/pull/413
* Fix problem in numdb with missing sub-propertiesArthur de Jong2022-02-131-6/+8
| | | | | If a numdb data file line contains multiple values or ranges the sub-ranges were only applied to the last value in the range.
* Only process the shortest matches in the numdb moduleArthur de Jong2021-04-111-71/+31
| | | | | | | | | | | | | | This ensures that matching numbers is done consistently when the numdb database file has conflicting information about the length of numbers. This also refactors the _find() function to be simpler and reduces the number of recursive calls that have to be done. The tests have been re-formatted to use pprint to make it easier to spot differences if any of the tests fail (instead of just saying expected True, got False). Closes https://github.com/arthurdejong/python-stdnum/issues/257
* Switch from import-order to isortArthur de Jong2019-03-031-0/+1
|
* Improvements reported by pylintArthur de Jong2019-02-171-2/+2
|
* Minor code improvements (mostly PEP8)Arthur de Jong2017-09-111-1/+1
|
* Make import ordering consistentArthur de Jong2017-09-111-0/+1
|
* Docstring improvementsArthur de Jong2017-09-111-1/+3
|
* Ensure 100% branch coverageArthur de Jong2017-08-281-4/+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.
* Avoid leaving open file descriptor in testArthur de Jong2016-09-101-1/+2
|
* Read numdb files in context managerArthur de Jong2016-05-091-2/+2
| | | | | | | This ensures that the file is explicitly closed in the function to avoid "unclosed file" warnings. See: https://github.com/arthurdejong/python-stdnum/issues/33
* Code style improvementsArthur de Jong2015-10-111-3/+8
| | | | | | | 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 numdb test fileArthur de Jong2015-10-101-1/+1
| | | | This places the test database file in the tests directory.
* Fix common spelling mistakeArthur de Jong2014-11-011-1/+1
|
* Remove empty lineArthur de Jong2013-06-071-1/+0
|
* Fix doctest to not be dependant on dict orderingArthur de Jong2013-04-261-15/+42
|
* ensure that the module docstrings are in a somewhat more ↵Arthur de Jong2012-02-261-2/+4
| | | | | | usable format git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@165 9dea7c4f-944c-4273-ac1a-574ede026edc
* rename numdb test fileArthur de Jong2012-02-201-1/+1
| | | | git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@158 9dea7c4f-944c-4273-ac1a-574ede026edc
* add "pragma: no cover" statements to code that isn't ↵Arthur de Jong2012-02-191-1/+1
| | | | | | expected to be covered git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@156 9dea7c4f-944c-4273-ac1a-574ede026edc
* make source code layout follow PEP8 moreArthur de Jong2011-08-191-5/+8
| | | | git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@76 9dea7c4f-944c-4273-ac1a-574ede026edc
* also support Python3 with the same codebase (see #3)Arthur de Jong2011-03-061-6/+11
| | | | git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@69 9dea7c4f-944c-4273-ac1a-574ede026edc
* allow most kind of characters in number rangesArthur de Jong2011-02-051-1/+1
| | | | git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@60 9dea7c4f-944c-4273-ac1a-574ede026edc
* revert r49 because it wasn't needed after allArthur de Jong2011-01-161-25/+13
| | | | git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@50 9dea7c4f-944c-4273-ac1a-574ede026edc
* introduce a full parameter that can be used to only ↵Arthur de Jong2011-01-161-12/+24
| | | | | | return the part that is in the database git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@49 9dea7c4f-944c-4273-ac1a-574ede026edc
* add test for partial matchArthur de Jong2011-01-161-0/+3
| | | | git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@47 9dea7c4f-944c-4273-ac1a-574ede026edc
* implement a new numdb module to hold information on ↵Arthur de Jong2010-11-241-0/+160
hierarchically organised numbers and switch the isbn module to use this format instead git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@42 9dea7c4f-944c-4273-ac1a-574ede026edc