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.
pip install ipyVerified import paths — ran on the pinned version, not inferred.
Demonstrates creating IP and IPSet objects, iterating through a network, checking IP types, and performing set operations.
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.
Always use the `IP().len()` method for robust IPv6 address comparisons.
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.
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.
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`.
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'))"`.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)`.No dependency data recorded yet.