Registry / http-networking / iptools

iptools

JSON →
library0.7.0pypypi✓ verified 84d ago

Python utilities for manipulating IPv4 and IPv6 addresses, including validation, subnetting, range operations, and RFC 1924 encoding/decoding. Current version 0.7.0, last updated 2016; in maintenance mode with low release cadence.

pip install iptools
INSTALL
IMPORT
SIG · IPTOOLS
I
iptools
http-networkingpythonv0.7.0
Install
1.5s avg
Import
10ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.002s · 17.9MB
glibc
py 3.103.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)
Debug
Known issues
breakingIpRange and IpRangeList do not support IPv6 CIDR notation directly; use IpRange with start/end addresses.
fix
For IPv6 ranges, create IpRange with two IPv6 addresses: IpRange('::1', '::ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff').
affects: <=0.7.0
deprecatedThe library is in maintenance mode; no new features are planned. Consider alternatives like ipaddress (stdlib) for IPv4/IPv6 manipulation.
fix
Use ipaddress from Python standard library.
affects: >=0.7.0
gotchavalidate_netmask may raise OverflowError for certain netmask values; fixed in 0.7.0 but still a potential issue if using older versions.
fix
Upgrade to iptools >= 0.7.0.
affects: <0.7.0
Errors
Common errors & fixes
AttributeError: module 'iptools' has no attribute 'IpRange'
Incorrect import path or namespace issue.
fix
Use '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.
fix
Use 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.
fix
Use 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.

Agent activity
6 hits · last 30 days
node
6
Resources
iptools — pip install iptools · libregistry