# stdnum.isni

ISNI (International Standard Name Identifier).

The International Standard Name Identifier (ISNI) is used to identify contributors to media content such as books, television programmes, and newspaper articles. The number consists of 16 digits where the last character is a check digit.

More information:

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

- https://isni.org/

    >>> validate('0000 0001 2281 955X')
    '000000012281955X'
    >>> validate('0000 0001 1111 955X')
    Traceback (most recent call last):
        ...
    InvalidChecksum: ...
    >>> validate('0000 0001 2281')
    Traceback (most recent call last):
        ...
    InvalidLength: ...
    >>> format('000000012281955X')
    '0000 0001 2281 955X'

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

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

stdnum.isni.format(number: str) → str

  Reformat the number to the standard presentation format.

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

  Check if the number provided is a valid ISNI.

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

  Check if the number is a valid ISNI. This checks the length and whether the check digit is correct.