Registry / type-stubs / types-netaddr

types-netaddr

JSON →
library1.3.0.20260518pypypiunverified

This package provides static type checking stubs for the `netaddr` library, enabling tools like MyPy or Pyright to perform comprehensive type analysis on code that uses `netaddr`. It is part of the Python typeshed project, which maintains type hints for popular Python packages. The current version is `1.3.0.20260408` and it follows the release cadence of the typeshed project, updating frequently to reflect changes in `netaddr`.

pip install types-netaddr
INSTALL
IMPORT
SIG · TYPES-NETADDR
T
types-netaddr
type-stubspythonv1.3.0.20260518
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3.0.20260518 · 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.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibc
py 3.103.920 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.

IPAddress
from netaddr_stubs import IPAddress
from netaddr_stubs import IPAddress

To use `types-netaddr`, you first need to install both `netaddr` and `types-netaddr`. You then write your Python code using `netaddr` with type hints as usual. A type checker like MyPy or Pyright will automatically find and utilize the stubs provided by `types-netaddr` during static analysis, without requiring any special imports from `types_netaddr` itself. The example shows a simple function using `IPAddress` with type hints, which would be checked by a type checker.

from netaddr import IPAddress def check_ip_type(ip_str: str) -> bool: ip = IPAddress(ip_str) return ip.is_unicast() # Example usage (runtime behaviour is handled by netaddr) # Type checkers will use types-netaddr to validate the above type hints. print(check_ip_type('192.168.1.1')) print(check_ip_type('224.0.0.1'))
Debug
Known issues
gotchaInstalling `types-netaddr` does NOT install the `netaddr` library itself. It only provides typing stubs. You must install `netaddr` separately if you intend to run the code.
fix
Ensure both `pip install netaddr` and `pip install types-netaddr` are executed.
affects: All versions
gotchaYou should never import directly from `types_netaddr`. The stubs are automatically discovered by type checkers for imports made from the actual `netaddr` library.
fix
All imports should be `from netaddr import ...`.
affects: All versions
gotchaThese stubs are only useful for static type checking tools (e.g., MyPy, Pyright). They do not alter runtime behavior or provide any new functionality at runtime.
fix
Ensure you are using a type checker in your development workflow to benefit from the stubs.
affects: All versions
Upgrade
Version history
1.3.0.20260518latest on PyPI · released May 18, 2026
Audit
Dependencies
netaddrrequiredThis package provides type stubs for `netaddr`; `netaddr` itself must be installed to actually use the functionality.
Agent activity
25 hits · last 30 days
node
24
OpenAI (training)
1
Resources
types-netaddr — pip install types-netaddr · libregistry