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

BUG on validate SIRET code #291

Closed BIGBen99 closed 2 years ago

BIGBen99 commented 2 years ago

Python-stdnum rejects valid SIRET code (356 000 000 09075). Some SIRET codes are valid instead of validating Luhn algorithm.

For SIRET code that don't validate Luhn algorithm, the sum of all digits should be a multiple of 5. https://www.sirene.fr/sirene/public/recherche Annotation 2022-03-07 121436

cedk commented 2 years ago

Indeed it is only the SIRET of "La Poste" that has an exception.

arthurdejong commented 2 years ago

Thanks @BIGBen99 for reporting this. Thanks @cedk for looking into this and providing the fix. It has been merged as 73f5e3a.

alexis-via commented 2 years ago

Thanks! I hope we'll have a new release on pypi soon so that all users can benefit from this fix.

alexis-via commented 1 year ago

@arthurdejong Would it be possible to make a new release of stdnum, so that non-expert users can benefit from this fix (and certainly others) ?

arthurdejong commented 1 year ago

Hi @alexis-via, Sorry it took so long but release 1.18 was just uploaded to PyPI that includes this fix (and more).

alexis-via commented 1 year ago

@arthurdejong Great ! Thank you so much Arthur !