# stdnum.grid

GRid (Global Release Identifier).

The Global Release Identifier is used to identify releases of digital sound recordings and uses the ISO 7064 Mod 37, 36 algorithm to verify the correctness of the number.

    >>> validate('A12425GABC1234002M')
    'A12425GABC1234002M'
    >>> validate('Grid: A1-2425G-ABC1234002-M')
    'A12425GABC1234002M'
    >>> validate('A1-2425G-ABC1234002-Q') # incorrect check digit
    Traceback (most recent call last):
        ...
    InvalidChecksum: ...
    >>> compact('A1-2425G-ABC1234002-M')
    'A12425GABC1234002M'
    >>> format('A12425GABC1234002M')
    'A1-2425G-ABC1234002-M'

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

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

stdnum.grid.format(number: str, separator: str = '-') → str

  Reformat the number to the standard presentation format.

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

  Check if the number is a valid GRid.

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

  Check if the number is a valid GRid.