Skip to content

Conversation

@nvmbrasserie
Copy link
Contributor

@nvmbrasserie nvmbrasserie commented Nov 20, 2024

Add OGRN (Russian Primary State Registration Number) validation and formatting

Added a new module for validating and formatting Russian OGRN numbers.
Implemented validation for OGRN length, checksum, and federal subject code.
Added a normalization function to format OGRN into valid 13- or 15-digit numbers.
Introduced a helper function to calculate the OGRN control digit.
Added basic usage examples and doctests for OGRN validation.

https://docs.trellix.com/bundle/data-loss-prevention-11.10.x-classification-definitions-reference-guide/page/GUID-945B4343-861E-4A57-8E60-8B6028871BA1.html

@nvmbrasserie nvmbrasserie marked this pull request as draft November 20, 2024 14:29
@nvmbrasserie nvmbrasserie marked this pull request as ready for review November 21, 2024 11:27
@nvmbrasserie nvmbrasserie changed the title ogrn validation Add russian OGRN Nov 27, 2024
@arthurdejong
Copy link
Owner

Hi @nvmbrasserie,

Thanks for your PR.

The link you provided no longer seems to work.

I did find https://ru.wikipedia.org/wiki/Основной_государственный_регистрационный_номер which seems to be the same format, but only the 13 digit variant. The 15 digit variant seems to be https://ru.wikipedia.org/wiki/Основной_государственный_регистрационный_номер_индивидуального_предпринимателя (OGRNIP).

I understand you combined checking of both formats in this module. I've updated the documentation to reflect this. I've also made some changes to the functions to match those of other modules within python-stdnum and cleaned up the tests a bit. I've also fixed the copyright header.

I've merged it as 1386f67.

@nvmbrasserie
Copy link
Contributor Author

Hi @arthurdejong! Thank you for cleaning it up and merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants