https://github.com/netdevops/hier_config
Hierarchical Configuration
https://github.com/netdevops/hier_config
configuration-management network-analysis network-programming
Last synced: 10 days ago
JSON representation
Hierarchical Configuration
- Host: GitHub
- URL: https://github.com/netdevops/hier_config
- Owner: netdevops
- License: mit
- Created: 2018-05-11T14:49:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-11-05T00:57:32.000Z (21 days ago)
- Last Synced: 2025-11-05T02:29:41.228Z (21 days ago)
- Topics: configuration-management, network-analysis, network-programming
- Language: Python
- Size: 8.96 MB
- Stars: 136
- Watchers: 7
- Forks: 30
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-network-automation - Hierarchical Configuration - Hierarchical Configuration is a Python library that is able to take a running configuration of a network device, compare it to its intended configuration, and build the remediation steps necessary bring a device into spec with its intended configuration. (Library / NETCONF)
- awesome-network-automation - Hierarchical Configuration - Hierarchical Configuration is a Python library that is able to take a running configuration of a network device, compare it to its intended configuration, and build the remediation steps necessary bring a device into spec with its intended configuration. (Library / NETCONF)
README
# Hierarchical Configuration
Hierarchical Configuration, also known as `hier_config`, is a Python library designed to query and compare network devices configurations. Among other capabilities, it can compare the running config to an intended configuration to determine the commands necessary to bring a device into compliance with its intended configuration.
Hierarchical Configuration has been used extensively on:
- [x] Cisco IOS
- [x] Cisco IOSXR
- [x] Cisco NXOS
- [x] Arista EOS
- [x] HP Procurve (Aruba AOSS)
In addition to the Cisco-style syntax, hier_config offers experimental support for Juniper-style configurations using set and delete commands. This allows users to remediate Junos configurations in native syntax. However, please note that Juniper syntax support is still in an experimental phase and has not been tested extensively. Use with caution in production environments.
- [x] Juniper JunOS
- [x] VyOS
Hier Config is compatible with any NOS that utilizes a structured CLI syntax similar to Cisco IOS or Junos OS.
The code documentation can be found at: https://hier-config.readthedocs.io/en/latest/
Installation
============
### PIP
Install from PyPi:
```shell
pip install hier-config
```
Quick Start
===========
### Step 1: Import Required Classes
```python
from hier_config import WorkflowRemediation, get_hconfig, Platform
from hier_config.utils import read_text_from_file
```
### Step 2: Load Configurations
Load the running and intended configurations as strings:
```python
running_config_text = read_text_from_file("./tests/fixtures/running_config.conf")
generated_config_text = read_text_from_file("./tests/fixtures/generated_config.conf")
```
### Step 3: Create HConfig Objects
Specify the device platform (e.g., `Platform.CISCO_IOS`):
```python
running_config = get_hconfig(Platform.CISCO_IOS, running_config_text)
generated_config = get_hconfig(Platform.CISCO_IOS, generated_config_text)
```
### Step 4: Initialize WorkflowRemediation
Compare configurations and generate remediation steps:
```python
workflow = WorkflowRemediation(running_config, generated_config)
print("Remediation Configuration:")
print(workflow.remediation_config)
```
This guide gets you started with Hier Config in minutes! For more details, visit [Hier Config Documentation Site](https://hier-config.readthedocs.io/en/latest/).