cached-ipaddress
Cache construction of ipaddress objects
What it is and what it does
cached-ipaddress wraps Python's standard ipaddress module to maintain an in-memory cache of IP address objects and their computed properties. When you call cached_ip_addresses() with a string, it returns a cached IPAddress object if one already exists for that address, or constructs and caches a new one. This avoids the overhead of repeatedly parsing and constructing the same IP addresses—useful in network monitoring, device discovery, or any scenario where you process many IP addresses with high repetition.
The package depends on propcache for efficient property caching on the underlying objects. It returns None for invalid IP address strings rather than raising an exception, making it safe to use in defensive code paths. The module is lightweight and designed as a drop-in optimization for applications that already use the ipaddress module.
Use it for:
- Network monitoring systems that repeatedly check properties of the same source or destination IPs.
- IoT or Bluetooth device discovery where you encounter the same device addresses across multiple scan cycles.
- Log parsing or traffic analysis where IP addresses repeat frequently and you need fast property checks.
- Caching layers in network security tools that classify or filter IPs by type (loopback, private, multicast, etc.).
- High-frequency network telemetry collection where the same peer addresses appear in many packets.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Caches IP address object construction and property lookups to avoid repeated overhead when the same IP addresses are encountered multiple times.
Yes, if your application repeatedly processes the same IP addresses and profiles show ipaddress object construction as a bottleneck. The permissive MIT license and active maintenance make it low-risk. Install friction is moderate due to the compiled propcache dependency, but the wheel is available for modern Python versions. Skip it if you process mostly unique IPs or don't measure ipaddress overhead as significant.
Install
cached-ipaddress on PyPI
pip
pip install cached-ipaddressuv
uv add cached-ipaddresspoetry
poetry add cached-ipaddressInstalling cached-ipaddress
Before you install
Medium install friction due to a compiled wheel dependency (propcache). Active maintenance with a recent release; last commit was 2026-08-10. Supports Python 3.9 through 3.14.
License in practice
MIT license permits commercial and private use with minimal restrictions—you may use, modify, and distribute this package freely as long as you include the license notice.
Quickstart
from cached_ipaddress import cached_ip_addresses
ip = cached_ip_addresses("127.0.0.1")
if ip:
print(ip.is_loopback) # True
Requires Python 3.9 or later.
Verify before relying
- Whether the cache is thread-safe or suitable for concurrent access patterns.
- Memory footprint and eviction strategy for the internal cache under high-volume IP address streams.
- Performance improvement magnitude compared to direct ipaddress module use in typical workloads.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — propcache |
| Maintenance | actively maintained — 79 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 94,608/month — #13,320 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cached_ipaddress-1.1.2-cp314-cp314-manylinux_2_41_x86_64.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
aioouiPerforms asynchronous lookups of…
permissive · top 15,000 on PyPI
ipaddrProvides utilities for parsing, validating, and…
permissive · top 15,000 on PyPI
ipaddressProvides IPv4 and IPv6 address manipulation for…
permissive · top 5,000 on PyPI
bluetooth-adaptersEnumerates and locates Bluetooth adapters on a…
permissive · top 15,000 on PyPI
netaddrRepresents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
python-ipwareExtracts a client's IP address from web request…
permissive · top 5,000 on PyPI
types-ipaddressProvides type stubs for Python's standard…
permissive · top 15,000 on PyPI
aiozoneinfoFetches timezone information asynchronously…
permissive · top 15,000 on PyPI
aiodhcpwatcherWatches for DHCP packets on the network using…
permissive · top 15,000 on PyPI
multiaddrParses, constructs, and manipulates…
permissive · top 15,000 on PyPI