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'
Traceback (most recent call last):
    ...
InvalidChecksum: ...
stdnum.grid.compact(number)

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 passed number to the standard format.

stdnum.grid.is_valid(number)

Checks to see if the number provided is a valid GRid.

stdnum.grid.validate(number)

Checks to see if the number provided is a valid GRid.

Previous topic

stdnum.gr.vat

Next topic

stdnum.hr.oib