{"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":"python","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,"search_vec":"'1.01':45 'address':16,32,62 'aim':20 'appear':48 'class':8 'comfort':24 'current':42 'handl':12 'interfac':28 'ip':31,39,61 'ipi':1,2 'ipv4':13,58 'ipv6':15,59 'librari':6 'mainten':52 'manipul':27 'mode':53 'modul':40 'net':38 'network':18,60,63 'notat':33 'offer':22 'pars':25 'perl':36 'provid':7 'python':5 'recent':56 'similar':34 'tool':10 'updat':57 'various':30 'version':43","created_at":"2026-04-14T01:26:21.328386+00:00","updated_at":"2026-04-16T15:47:17.565603+00:00","problems":[{"fix":"Use a Python environment with version 3.7 or older, or manually install a compatible version if one exists for newer Python versions (though 1.01 is the latest and supports up to 3.7). A common approach is to use a virtual environment with an older Python version: `pyenv install 3.7.9 && pyenv virtualenv 3.7.9 ipy_env && pyenv activate ipy_env && pip install ipy`.","cause":"This error typically occurs when trying to install IPy with a Python version newer than 3.7, as IPy version 1.01 is only compatible with Python 2.6 through 3.7.","error":"ERROR: Could not find a version that satisfies the requirement IPy (from versions: none) ERROR: No matching distribution found for IPy"},{"fix":"Ensure the package is correctly installed using `pip install ipy` (or `pip3 install ipy` for Python 3). If using virtual environments, activate the correct environment before installation. Verify installation by running `python -c \"import IPy; print(IPy.IP('192.168.1.1'))\"`.","cause":"This means the 'IPy' package is either not installed, or Python cannot find it in its configured paths. This can happen if installation failed, was done in a different environment, or there's a typo in the import statement.","error":"ModuleNotFoundError: No module named 'IPy'"},{"fix":"Instead of trying to call a non-existent 'range' method, iterate over the IP object directly or use its `len()` method for numeric comparison and iteration, or use methods like `IP.iter()` to get an iterator over IP addresses within a network. Example: `for ip_addr in IP('192.168.1.0/24'): print(ip_addr)`.","cause":"This error indicates an attempt to access a method or attribute named 'range' on an IPy 'IP' object, but no such method or attribute exists in the IPy library for generating IP address ranges directly.","error":"AttributeError: 'IP' object has no attribute 'range'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.01","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/autocracy/python-ipy","docs":null,"changelog":null,"pypi":"https://pypi.org/project/ipy/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking","auth-security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}