stdnum.cusip

CUSIP number (financial security identification number).

CUSIP (Committee on Uniform Securities Identification Procedures) numbers are used to identify financial securities. CUSIP numbers are a nine-character alphanumeric code where the first six characters identify the issuer, followed by two digits that identify and a check digit.

More information:

>>> validate('DUS0421C5')
'DUS0421C5'
>>> validate('DUS0421CN')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> to_isin('91324PAE2')
'US91324PAE25'
stdnum.cusip.calc_check_digit(number)

Calculate the check digits for the number.

stdnum.cusip.compact(number)

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

stdnum.cusip.is_valid(number)

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

stdnum.cusip.to_isin(number)

Convert the number to an ISIN.

stdnum.cusip.validate(number)

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