Skip to content
This repository has been archived by the owner on Oct 9, 2021. It is now read-only.
/ inquisitor Public archive

Python library to convert network outputs to structured JSON data.

License

Notifications You must be signed in to change notification settings

bwks/inquisitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inquisitor

Python library to convert network outputs to structured JSON data.

Usage

Create a virtual env

python3.6 -m venv .venv

Activate Virtual Env

source .venv/bin/activate

Install Inquisitor

pip install https://github.com/bobthebutcher/inquisitor/archive/master.zip

NetworkToCode TextFSM Templates

Leverage NetworkToCode TextFSM template repository ntc-tempaltes

git clone https://github.com/networktocode/ntc-templates.git

Usage

from inquisitor.constants import CISCO_IOS_TEMPLATE_MAP
from inquisitor.api import data_dict
from inquisitor.utils import jprint

vrf_data = '''
  Name                             Default RD            Protocols   Interfaces
  MGMT                             <not set>             ipv4        Gi0/0
  test-vrf                         65000:100             ipv4        Gi0/1
'''

vrfs = data_dict(template=CISCO_IOS_TEMPLATE_MAP['vrfs'], data_type='vrfs', raw_data=vrf_data)

jprint(vrfs)

{
  "vrfs": [
    {
      "name": "MGMT",
      "default_rd": "<not set>",
      "protocols": "ipv4",
      "interfaces": [
        "Gi0/0"
      ]
    },
    {
      "name": "test-vrf",
      "default_rd": "65000:100",
      "protocols": "ipv4",
      "interfaces": [
        "Gi0/1"
      ]
    }
  ]
}

About

Python library to convert network outputs to structured JSON data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages