{"id":5263,"library":"ipy","title":"IPy","description":"IPy is a Python library providing classes and tools for handling IPv4 and IPv6 addresses and networks. It aims to offer a comfortable parsing and manipulation interface for various IP address notations, similar to Perl's Net::IP module. The current version is 1.01, and it appears to be in maintenance mode with no recent updates.","status":"maintenance","version":"1.01","language":"en","source_language":"en","source_url":"https://github.com/autocracy/python-ipy","tags":["IPv4","IPv6","networking","IP addresses","networks"],"install":[{"cmd":"pip install ipy","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"symbol":"IP","correct":"from IPy import IP"},{"symbol":"IPSet","correct":"from IPy import IP, IPSet"}],"quickstart":{"code":"from IPy import IP, IPSet\n\n# Working with individual IP addresses and networks\nip_network = IP('192.168.1.0/24')\nprint(f\"Network: {ip_network}\")\nprint(f\"Version: {ip_network.version()}\")\nfor ip_addr in ip_network:\n    print(f\"  Host: {ip_addr}\")\n\nip_host = IP('::1')\nprint(f\"IPv6 Host: {ip_host}\")\nprint(f\"Is loopback: {ip_host.iptype() == 'LOOPBACK'}\")\n\n# Working with IPSet for multiple ranges\ns = IPSet([IP('10.0.0.0/22')])\ns.add(IP('192.168.1.0/29'))\nprint(f\"IPSet: {s}\")\nprint(f\"Is disjoint from 172.16.0.0/12: {s.isdisjoint(IPSet([IP('172.16.0.0/12')]))}\")","lang":"python","description":"Demonstrates creating IP and IPSet objects, iterating through a network, checking IP types, and performing set operations."},"warnings":[{"fix":"Consider migrating to Python's built-in `ipaddress` module for Python 3.3+ projects, or use an alternative actively maintained library for newer Python versions.","message":"IPy version 1.01 officially supports Python versions 2.6 through 3.7. Using it with newer Python versions (3.8+) may lead to compatibility issues or unexpected behavior as it has not been updated since December 2020.","severity":"breaking","affected_versions":">=3.8"},{"fix":"Always use the `IP().len()` method for robust IPv6 address comparisons.","message":"When comparing IPv6 addresses, using `IP().len()` for comparison is recommended over `len(IP)`. Addresses with an integer value greater than 64 bits can cause incorrect results with `len(IP)`.","severity":"gotcha","affected_versions":"1.01"},{"fix":"Be aware of this specific behavior during testing and validation of `IPSet` aggregation logic. This is not a functional bug but a known testing artifact.","message":"Fuzz testing with `IPSet` may produce spurious errors when the `IPSet` module aggregates two smaller prefixes into a larger one that matches the random prefix being tested against. This is noted as an 'Errata' in the package description.","severity":"gotcha","affected_versions":"1.01"},{"fix":"For Python 3.3+ projects, utilize the `ipaddress` module directly: `import ipaddress`. For Python versions where `ipaddress` is not available, `ipy` might still be a viable option, but consider its lack of recent updates.","message":"The `ipaddress` module, providing similar functionality for IPv4 and IPv6 address manipulation, has been part of the Python standard library since Python 3.3. For new projects on Python 3.3 and above, `ipaddress` is generally the preferred choice due to its native integration and ongoing maintenance.","severity":"deprecated","affected_versions":"<3.3 (recommended to use `ipaddress` for >=3.3)"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}