{
  "id": "python-ipaddress-table",
  "kind": "table",
  "slug": "python-ipaddress",
  "iil_id": null,
  "note_url": "https://iinventedlight.com/library/notes/python-ipaddress/",
  "title": "Python ipaddress - validate IPs, check subnets and iterate hosts for IPv4 and IPv6",
  "columns": [
    "name",
    "source",
    "detail"
  ],
  "rows": [
    {
      "name": "ip_address(address)",
      "source": "Python docs",
      "detail": "an IPv4Address or IPv6Address object"
    },
    {
      "name": "ip_network(address, strict=True)",
      "source": "Python docs",
      "detail": "an IPv4Network or IPv6Network object"
    },
    {
      "name": "ip_interface(address)",
      "source": "Python docs",
      "detail": "an IPv4Interface or IPv6Interface: an address plus its network"
    },
    {
      "name": "hosts()",
      "source": "Python docs",
      "detail": "returns an iterator over the usable hosts, which excludes the network address and the broadcast address (except for /31 networks)."
    },
    {
      "name": "num_addresses",
      "source": "Python docs",
      "detail": "is the total number of addresses; prefixlen is the prefix length in bits."
    },
    {
      "name": "subnet_of(other)",
      "source": "Python docs",
      "detail": "and supernet_of(other) compare networks."
    },
    {
      "name": "is_private",
      "source": "Python docs",
      "detail": "is true for addresses not globally reachable per the IANA special registries, but false for the shared space 100.64.0.0/10."
    }
  ],
  "related_slugs": [
    "python-argparse"
  ],
  "license": "CC-BY-4.0",
  "source_license": "PSF-2.0 (Python docs); PSF-2.0 (python/cpython (GitHub)); prose restates cited source lines in own words",
  "as_of": "2026-11-18",
  "status": "fill-draft-20261118",
  "note": "Restated from the note's GREEN sources; check those sources before relying on a value."
}