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

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

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

Reformat the number to the standard presentation format.


Check if the number is a valid GRid.


Check if the number is a valid GRid.