Registry / devops / netutils

netutils

JSON →
library1.17.2pypypi✓ verified 83d ago

netutils is a Python library offering a collection of functions and objects for common network automation tasks, such as BGP ASN conversion, interface name standardization, MAC address formatting, IP address calculations, and configuration parsing. It is actively maintained with frequent releases, typically every few weeks, and is currently at version 1.17.2.

pip install netutils
INSTALL
IMPORT
SIG · NETUTILS
N
netutils
devopspythonv1.17.2
Install
1.8s avg
Import
Disk
25MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.17.2 · 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.940 runs
installs and imports cleanly · install 0.0s · import 0.000s · 44.1MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 1.8s · import 0.000s · 45MB
25MB installed
● package 25MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

metadata
from netutils import metadata
from netutils.config.parser import ConfigParser

This quickstart demonstrates how to use `netutils.config.parser.ConfigParser` to parse a sample Cisco IOS configuration. It also includes a basic example of an IP utility function. Note that `ntc-templates` is a required dependency for the `ConfigParser` to function correctly.

from netutils.config.parser import ConfigParser # Example Cisco IOS configuration string config_text = """ hostname my-router interface GigabitEthernet0/0 ip address 192.168.1.1 255.255.255.0 no shutdown interface Loopback0 ip address 10.0.0.1 255.255.255.255 """ # Instantiate the ConfigParser for Cisco IOS # 'cisco_ios' is a key from ntc-templates, which is a required dependency try: parser = ConfigParser(config_text, 'cisco_ios') parsed_config = parser.parse() print("Parsed Configuration:\n", parsed_config) # Example using an IP utility function from netutils.ip import is_valid_ipv4_address print(f"Is '192.168.1.1' a valid IPv4 address? {is_valid_ipv4_address('192.168.1.1')}") except ImportError: print("Error: 'ntc-templates' not found. Please install it: pip install ntc-templates") except Exception as e: print(f"An error occurred: {e}")
Debug
Known issues
breakingDirect instantiation of `HPEConfigParser` was deprecated in v1.17.0. Users should now subclass a private internal class instead.
fix
Refactor code to subclass the appropriate private configuration parser class if extending HP Network OS parsing functionality. Consult the latest documentation for the correct base class.
affects: >=1.17.0
gotchaThe `encrypt_cisco_type7` function in versions prior to 1.15.2 incorrectly ignored a `salt=0` parameter, leading to unexpected encryption results for that specific salt value.
fix
Upgrade to `netutils` version 1.15.2 or newer to ensure correct handling of `salt=0` in `encrypt_cisco_type7`.
affects: <1.15.2
gotchaParsing empty Palo Alto Networks PanOS configurations in versions prior to 1.17.1 would raise an error.
fix
Upgrade to `netutils` version 1.17.1 or newer to correctly parse empty Palo Alto Networks PanOS configurations.
affects: <1.17.1
breakingThe library explicitly requires Python versions >=3.10 and <3.15.
fix
Ensure your Python environment is within the supported range (e.g., Python 3.10, 3.11, 3.12, 3.13, 3.14).
affects: All versions >=1.17.2
gotchaMany configuration parsing functionalities (e.g., `ConfigParser`) rely on the `ntc-templates` library. Failure to install `ntc-templates` will result in `ImportError` or `ConfigParser` not being able to find device OS definitions.
fix
Install `ntc-templates` explicitly: `pip install ntc-templates`.
affects: All versions
Upgrade
Version history
1.17.2latest on PyPI · released Apr 8, 2026
Audit
Dependencies
ntc-templatesrequiredRequired for configuration parsing functionality, specifically for vendor-specific parsing rules.
napalmoptionalOptional dependency for functions that integrate with NAPALM (e.g., `get_napalm_getters`).
Agent activity
8 hits · last 30 days
node
8
Resources
netutils — pip install netutils · libregistry