{"id":21464,"library":"iptools","title":"iptools","description":"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.","status":"maintenance","version":"0.7.0","language":"python","source_language":"en","source_url":"https://github.com/bd808/python-iptools","tags":["ipv4","ipv6","networking","validation"],"install":[{"cmd":"pip install iptools","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Direct import is recommended; library paths may cause AttributeError if not careful.","wrong":"import iptools; iptools.IpRange","symbol":"IpRange","correct":"from iptools import IpRange"},{"note":"IpRangeList is a top-level module, not a submodule.","wrong":"from iptools.IpRange import IpRangeList","symbol":"IpRangeList","correct":"from iptools import IpRangeList"},{"note":"validate_cidr is a top-level function, not in utils.","wrong":"import iptools; iptools.utils.validate_cidr","symbol":"validate_cidr","correct":"from iptools import validate_cidr"}],"quickstart":{"code":"from iptools import IpRange, IpRangeList, validate_cidr\n\n# Validate a CIDR range\nif validate_cidr('192.168.1.0/24'):\n    print('Valid CIDR')\n\n# Create an IP range and iterate\nr = IpRange('192.168.1.0', '192.168.1.255')\nfor ip in r:\n    print(ip)\n\n# Combine ranges\nrl = IpRangeList(['192.168.1.0/24', '10.0.0.0/8'])\nprint(rl)","lang":"python","description":"Simple validation, IP range creation, and list operations."},"warnings":[{"fix":"For IPv6 ranges, create IpRange with two IPv6 addresses: IpRange('::1', '::ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff').","message":"IpRange and IpRangeList do not support IPv6 CIDR notation directly; use IpRange with start/end addresses.","severity":"breaking","affected_versions":"<=0.7.0"},{"fix":"Use ipaddress from Python standard library.","message":"The library is in maintenance mode; no new features are planned. Consider alternatives like ipaddress (stdlib) for IPv4/IPv6 manipulation.","severity":"deprecated","affected_versions":">=0.7.0"},{"fix":"Upgrade to iptools >= 0.7.0.","message":"validate_netmask may raise OverflowError for certain netmask values; fixed in 0.7.0 but still a potential issue if using older versions.","severity":"gotcha","affected_versions":"<0.7.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'from iptools import IpRange' instead of 'import iptools; iptools.IpRange'.","cause":"Incorrect import path or namespace issue.","error":"AttributeError: module 'iptools' has no attribute 'IpRange'"},{"fix":"Use smaller range chunks or upgrade to iptools >= 0.7.0 which includes a fix for large ranges but may still have limits.","cause":"Very large IP ranges (e.g., IPv6) cause overflow in range calculation.","error":"OverflowError: Python int too large to convert to C long"},{"fix":"Use IpRange with two IP addresses, not a CIDR. For CIDR, use IpRangeList(['192.168.1.0/24']) or parse manually.","cause":"Passing a CIDR string to IpRange where start and end addresses are expected.","error":"ValueError: invalid literal for int() with base 10: ..."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}