skillfed

cached-ipaddress

Cache construction of ipaddress objects

cached-ipaddress v1.1.2 94.6K downloads/30d#13,320 on PyPI3
Permissive license MIT Active released

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-ipaddress

uv

uv add cached-ipaddress

poetry

poetry add cached-ipaddress

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries

Tags

ip address cachingcached ipaddress objectsip address performanceipaddress object cacherepeated ip lookup optimizationnetwork address cachingip property cache
cachingnetworkingperformance-optimization

More Libraries packages