def ipv6(value):
    try:
        socket.inet_pton(socket.AF_INET6, value)
        return value
    except socket.error:
        raise ValueError('{0} is not a valid ipv4 address'.format(value))
Validate an IPv6 address
dataset/ETHPy150Open noirbizarre/flask-restplus/flask_restplus/inputs.py/ipv6