A thin caching wrapper around Python's ipaddress module that memoizes construction of IPv4Address, IPv6Address, IPv4Network, IPv6Network, and IPv4Interface/IPv6Interface objects to reduce overhead when the same addresses are parsed repeatedly. Current version 1.1.2, maintained actively, supports Python >=3.9.
pip install cached-ipaddressNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Import and use a cached IP address object. The caching is internal; no manual setup required.
Use identical constructor for caching benefit; do not assume object identity with `is`, rely on `==`.
Consider periodic cache clearing or using a bounded cache if memory is a concern (not built-in).