# 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:

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

    >>> 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: str) → str

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

stdnum.eu.ecnumber.compact(number: str) → str

  Convert the number to the minimal representation.

stdnum.eu.ecnumber.is_valid(number: str) → bool

  Check if the number provided is a valid EC Number.

stdnum.eu.ecnumber.validate(number: str) → str

  Check if the number provided is a valid EC Number.