PyFunceble/__init__.py
def ipv4_syntax_check(ip):  # pragma: no cover
    """
    Check the syntax of the given IPv4.

    :param ip: The IPv4 to check the syntax for.
    :type ip: str

    :return: The syntax validity.
    :rtype: bool

    .. warning::
        If an empty or a non-string :code:`ip` is given, we return :code:`None`.
    """

    if ip and isinstance(ip, str):
        # The given IP is not empty nor None.
        # and
        # * The given IP is a string.

        # We silently load the configuration.
        load_config(True)

        return Check(ip).is_ip_valid()

    # We return None, there is nothing to check.
    return None
def ipv4_syntax_check(ip):  # pragma: no cover
    if ip and isinstance(ip, str):
        # The given IP is not empty nor None.
        # and
        # * The given IP is a string.

        # We silently load the configuration.
        load_config(True)

        return Check(ip).is_ip_valid()

    # We return None, there is nothing to check.
    return None
def ipv4_syntax_check ( ip ) : # pragma: no cover if ip and isinstance ( ip , str ) : # The given IP is not empty nor None. # and # * The given IP is a string. # We silently load the configuration. load_config ( True ) return Check ( ip ) . is_ip_valid ( ) # We return None, there is nothing to check. return None
Check the syntax of the given IPv4.

    :param ip: The IPv4 to check the syntax for.
    :type ip: str

    :return: The syntax validity.
    :rtype: bool

    .. warning::
        If an empty or a non-string :code:`ip` is given, we return :code:`None`.
Check the syntax of the given IPv4 .