Install & Compatibility
Where this runs
tested against v0.7.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.002s · 17.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
IpRange
✓ from iptools import IpRange
✗ import iptools; iptools.IpRange
Direct import is recommended; library paths may cause AttributeError if not careful.
IpRangeList
✓ from iptools import IpRangeList
✗ from iptools.IpRange import IpRangeList
IpRangeList is a top-level module, not a submodule.
validate_cidr
✓ from iptools import validate_cidr
✗ import iptools; iptools.utils.validate_cidr
validate_cidr is a top-level function, not in utils.
Simple validation, IP range creation, and list operations.
from iptools import IpRange, IpRangeList, validate_cidr
# Validate a CIDR range
if validate_cidr('192.168.1.0/24'):
print('Valid CIDR')
# Create an IP range and iterate
r = IpRange('192.168.1.0', '192.168.1.255')
for ip in r:
print(ip)
# Combine ranges
rl = IpRangeList(['192.168.1.0/24', '10.0.0.0/8'])
print(rl)
Errors
Common errors & fixes
AttributeError: module 'iptools' has no attribute 'IpRange'
Incorrect import path or namespace issue.
fixUse 'from iptools import IpRange' instead of 'import iptools; iptools.IpRange'.
OverflowError: Python int too large to convert to C long
Very large IP ranges (e.g., IPv6) cause overflow in range calculation.
fixUse smaller range chunks or upgrade to iptools >= 0.7.0 which includes a fix for large ranges but may still have limits.
ValueError: invalid literal for int() with base 10: ...
Passing a CIDR string to IpRange where start and end addresses are expected.
fixUse IpRange with two IP addresses, not a CIDR. For CIDR, use IpRangeList(['192.168.1.0/24']) or parse manually.
Upgrade
Version history
0.7.0latest on PyPI · released Jan 7, 2019
Audit
Dependencies
No dependency data recorded yet.