• Stars
    star
    113
  • Rank 308,304 (Top 7 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Library to help parsing/translating YANG models from/to native text/structures

Yangify

Yangify is a framework that allows you to easily write code that can map structured and unstructured data into data modelled using YANG models. Yangify can also do the opposite operation and convert data modelled with YANG models into other structured or non-structured data. This allows you to easily write code that can parse native output/data/configuration from network devices and map them into YANG models and vice-versa.

Installing yangify

You can install yangify with pip:

pip install yangify

Ways to Get Started with Yangify

Start Executing Yangify Juptyer Notebooks

Step 1

Clone the repository:

$ git clone https://github.com/networktocode/yangify

Step 2

Navigate into yangify:

$ cd yangify

Step 3

Build the containers needed.

$ make build_test_containers

Step 4

Start a container so you can run Jupyter notebooks:

make dev_jupyter

Step 5

Launch a browser and navigate to the following URL:

http://127.0.0.1:8888

You will find all of the notebooks in docs/tutorials and also docs/tutorials/parsing-quickstart.

These same notebooks can be viewed without being interactive in the Read the Docs.

Go Right into a Working Yangify Dev Environment

Note: this dev environment is built for parsing.

Step 1

Clone the repository:

$ git clone https://github.com/networktocode/yangify

Step 2

Navigate into yangify:

$ cd yangify

Step 3

Build the containers needed.

$ make build_test_containers

Step 4

Create a container that you'll use for development & testing. This container will get built such that you can modify files in your local directory and execute them within the container environment. Great for using your local text editor and executing in pre-buit enviornment.

make enter_dev_container

This will drop you right into the container.

Step 5

Install yangify with make install:

root@e726de8f2226:/yangify# make install
poetry install
Skipping virtualenv creation, as specified in config file.
Installing dependencies from lock file

Nothing to install or update

  - Installing yangify (0.1.0)
A setup.py file already exists. Using it.
root@e726de8f2226:/yangify#

Step 6

Navigate into the parsing-quickstart directory (inside the container):

root@e726de8f2226:/yangify# cd docs/tutorials/parsing-quickstart/
root@e726de8f2226:/yangify/docs/tutorials/parsing-quickstart#

Step 7

Try out the dev-yangify.py script:

root@e726de8f2226:/yangify/docs/tutorials/parsing-quickstart# python dev-yangify.py --vlans
{
    "openconfig-vlan:vlans": {
        "vlan": [
            {
                "vlan-id": 10,
                "config": {
                    "vlan-id": 10,
                    "status": "ACTIVE"
                }
            },
            {
                "vlan-id": 20,
                "config": {
                    "vlan-id": 20,
                    "name": "web_vlan",
                    "status": "ACTIVE"
                }
            },
            {
                "vlan-id": 30,
                "config": {
                    "vlan-id": 30,
                    "name": "test_vlan",
                    "status": "ACTIVE"
                }
            }
        ]
    }
}
root@e726de8f2226:/yangify/docs/tutorials/parsing-quickstart#

More Repositories

1

awesome-network-automation

Curated Awesome list about Network Automation
2,230
star
2

ntc-templates

TextFSM templates for parsing show commands of network devices
Python
1,072
star
3

ntc-ansible

Multi-vendor network modules
Python
278
star
4

ntc-netbox-plugin-onboarding

A plugin for NetBox to easily onboard new devices.
Python
245
star
5

netutils

Python library that is a collection of functions and objects for common network automation tasks.
Python
214
star
6

pyntc

Python library focused on tasks related to device level and OS management.
Python
169
star
7

network-importer

The network importer is a tool/library to analyze and/or synchronize an existing network with a Network Source of Truth (SOT), it's designed to be idempotent and by default it's only showing the difference between the running network and the remote SOT.
Python
166
star
8

diffsync

A utility library for comparing and synchronizing different datasets.
Python
144
star
9

ntc-rosetta

The missing bridge between industry standard CLIs and YANG
Python
102
star
10

circuit-maintenance-parser

Python library to parse circuit maintenances from network service providers.
HTML
71
star
11

fortimanager-ansible

Ansible Modules to manage Fortinet FortiManager
Python
65
star
12

schema-enforcer

Schema Enforcer provides a framework for testing structured data against schema definitions.
Python
46
star
13

netbox_day_2020

NetBox Day 2020 Content
41
star
14

ntc-netbox-plugin-metrics-ext

NetBox Plugin to improve the instrumentation of NetBox and expose additional metrics (Application Metrics, RQ Worker).
Python
38
star
15

ntc-soteria

ACL/Flow Auditing Tool based on Batfish
Python
30
star
16

anit

Ansible Network Infrastructure Testing Framework
Python
28
star
17

interop2020-slides

Network Automation Summit Slides
25
star
18

jdiff

Python
21
star
19

pynxos

A library for managing Cisco NX-OS devices through NX-API.
Python
17
star
20

netbox-training

Examples and demos from Network to Code's NetBox training
Jupyter Notebook
16
star
21

interop2020-ansible-molecule

Ansible Molecule demo for Network Automation
Python
14
star
22

2022-ntc-content

Content from NTCers at conferences, blogs, videos, and other events in 2022.
Python
14
star
23

nso-restconf-postman-examples

12
star
24

netscaler-ansible

Ansible Modules to manage Citrix Netscaler devices
Python
11
star
25

ansible-replay

A way to play captured Ansible output in a way that looks like a real ansible-playbook was ran
Python
10
star
26

bsn-ansible

Ansible modules for automating Big Switch Networks' products
Python
9
star
27

clemea-demo

For Cisco Live Amsterdam workshop
Python
8
star
28

cisco-test-modules

Python
6
star
29

ntc-rosetta-conf

Restconf interface for rosetta
Python
5
star
30

meetups

Relevant code and slides for Network-to-Coders meetups
5
star
31

flowtracker

Trace a flow through a data center fabric of Nexus switches
Python
5
star
32

ntc-yang-models

Usable and relevant YANG models for everyone
Python
5
star
33

arista-atd

Python
5
star
34

interop2020-batfish

4
star
35

ntc-misc

General repository used for sharing misc one-off projects
Python
4
star
36

clus-2018

Python
3
star
37

inog9

Slides and labs from iNOG 9 in Dublin
HTML
3
star
38

ntc-sample-pbs

General Testing of Playbooks
2
star
39

nornir-pyntc

Pyntc Plugin for Nornir
Python
2
star
40

nautobot-example-dns-manager

Python
2
star
41

ntc-tesuto

Menu-driven application to manage Tesuto emulations
Python
2
star
42

test-api

1
star
43

python-checker

Docker image for checking Python code easily
Shell
1
star
44

cicd-testing

1
star