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
495 stars 205 forks source link

Add CC (Número de Cartão de Cidadão, Portuguese Identity number) #265

Closed davidmgvaz closed 3 years ago

davidmgvaz commented 3 years ago

This adds CC (Número de Cartão de Cidadão, Portuguese Identity number)

davidmgvaz commented 3 years ago

Hi @DimitriPapadopoulos,

I have already corrected the two typos you found and also split the calck_check_digit to an autonomous function, as I saw that was the standard practice

arthurdejong commented 3 years ago

Hi @davidmgvaz

Thanks for the contribution. Could you provide some test numbers that can be used to confirm the implementation? For most number formats we have a number of tests with valid numbers to be able to validate the correctness of the calculations.

arthurdejong commented 3 years ago

Also a part of the number is a Número de Identificação Civil which has its own check digit. Do you have any idea (or pointers) how to validate that number?

magamig commented 3 years ago

@arthurdejong any particular reason to not update the README?

arthurdejong commented 3 years ago

The README and documentation are updated as part of the release process with update/numlist.py.