File: utils.py

package info (click to toggle)
python-aioairq 0.4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 152 kB
  • sloc: python: 594; makefile: 5
file content (11 lines) | stat: -rw-r--r-- 251 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
import ipaddress


def is_valid_ipv4_address(address: str) -> bool:
    """Checks if address is a valid IPv4 address."""

    try:
        ipaddress.IPv4Address(address)
        return True
    except ipaddress.AddressValueError:
        return False