stdnum.casrn

CAS RN (Chemical Abstracts Service Registry Number).

The CAS Registry Number is a unique identifier assigned by the Chemical Abstracts Service (CAS) to a chemical substance.

More information:

>>> validate('87-86-5')
'87-86-5'
>>> validate('87-86-6')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
stdnum.casrn.calc_check_digit(number)

Calculate the check digit for the number. The passed number should not have the check digit included.

stdnum.casrn.compact(number)

Convert the number to the minimal representation.

stdnum.casrn.is_valid(number)

Check if the number provided is a valid CAS RN.

stdnum.casrn.validate(number)

Check if the number provided is a valid CAS RN.