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 support for Classification of Financial Instruments (CFI) #283

Closed vovavili closed 2 years ago

vovavili commented 2 years ago

Hello, developers of this wonderful and very useful package,

Can support for CFI be added please? That would be extremely helpful for my work project, I can't seem to find any open-source validator specifically for that ISO standard and my Pythonista skills are still not on a level high enough to make an elegant and neatly written pull request for this standard on my own. In theory this should be pretty easy to validate using string slicing but I can't figure out how to do this in a Pythonic way yet.

https://en.wikipedia.org/wiki/ISO_10962

Online CFI code lookup from USSEC: https://sec.report/CFI/

arthurdejong commented 2 years ago

Hi @vovavili, I've implemented validation of the CFI in a9039c1. It is mostly an classification system and not so much an identifier. There is also no check digit so the validation is limited to the format (6 letters) as well as checking against the published list of codes.