# 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:

- https://en.wikipedia.org/wiki/CUSIP

- https://www.cusip.com/

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

stdnum.cusip.calc_check_digit(number: str) → str

  Calculate the check digits for the number.

stdnum.cusip.compact(number: str) → str

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

stdnum.cusip.is_valid(number: str) → bool

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

stdnum.cusip.to_isin(number: str) → str

  Convert the number to an ISIN.

stdnum.cusip.validate(number: str) → str

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