stdnum.eu.ecnumber

EC Number (European Community number).

The EC Number is a unique seven-digit number assigned to chemical substances for regulatory purposes within the European Union by the European Commission.

More information:

>>> validate('200-001-8')
'200-001-8'
>>> validate('200-001-9')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('20-0001-8')
Traceback (most recent call last):
    ...
InvalidFormat: ...
stdnum.eu.ecnumber.calc_check_digit(number)

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

stdnum.eu.ecnumber.compact(number)

Convert the number to the minimal representation.

stdnum.eu.ecnumber.is_valid(number)

Check if the number provided is a valid EC Number.

stdnum.eu.ecnumber.validate(number)

Check if the number provided is a valid EC Number.