arthurdejong / python-stdnum

A Python library to provide functions to handle, parse and validate standard numbers.
https://arthurdejong.org/python-stdnum/
GNU Lesser General Public License v2.1
484 stars 203 forks source link

Add support for Panama TIN #348

Open unho opened 1 year ago

unho commented 1 year ago

Note this only adds support for the legal person's TIN number.

Adding support for Natural persons should be fairly easy based on the algorithm descriptions in https://studylib.es/doc/545131/algoritmo-para-el-calculo-del-digito-verificador-de-la-ru and the Python script at https://github.com/apple314159/panama-dv The reason why I didn't add support for those is that it would complicate the compact method, and will require performing plenty of tweaks when calculating the check digit, and this doesn't seems straightforward when we don't have plenty of examples for some of these variants.

Closes #102

unho commented 1 year ago

@arthurdejong I am not sure what is wrong with the CI. It says there are some lines of code not covered by tests, but I am pretty sure I have added specific tests for those. Any idea?

unho commented 1 year ago

@arthurdejong I have managed to figure out what was wrong. PR ready to review.