stdnum.isin

ISIN (International Securities Identification Number).

The ISIN is a 12-character alpha-numerical code specified in ISO 6166 used to identify exchange listed securities such as bonds, commercial paper, stocks and warrants. The number is formed of a two-letter country code, a nine character national security identifier and a single check digit.

This module does not currently separately validate the embedded national security identifier part (e.g. when it is a CUSIP).

More information:

>>> validate('US0378331005')
'US0378331005'
>>> validate('US0378331003')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> from_natid('gb', 'BYXJL75')
'GB00BYXJL758'
stdnum.isin.calc_check_digit(number)

Calculate the check digits for the number.

stdnum.isin.compact(number)

Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.

stdnum.isin.from_natid(country_code, number)

Generate an ISIN from a national security identifier.

stdnum.isin.is_valid(number)

Check if the number provided is valid. This checks the length and check digit.

stdnum.isin.validate(number)

Check if the number provided is valid. This checks the length and check digit.