import itertools


def is_valid_ean13(s):
    """Check whether a string is a valid EAN-13.

    EAN = `European Article Number
    <https://en.wikipedia.org/wiki/European_Article_Number>`_

    The string must not contain any separators; only the characters ``0-9``
    are allowed and the length of the string must be 13.

    :param str s: the string
    :return: ``True`` if the string is a valid EAN-13
    :rtype: bool
    :raise ValueError: if a character is not allowed or the length is wrong
    """
    if len(s) != 13:
        raise ValueError(f'length of string must be 13 not {len(s)}')
    if not s.isdecimal():
        raise ValueError('only characters 0-9 are allowed')
    return sum(int(c) * w for c, w in zip(s, itertools.cycle((1, 3)))) % 10 == 0