Skip to main content

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

Project description

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 jupyter

Step 5

Lanunch 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
/root/.poetry/bin/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/tutorial/parsing-quickstart/
root@e726de8f2226:/yangify/docs/tutorial/parsing-quickstart# 

Step 7

Try out the dev-yangify.py script:

root@e726de8f2226:/yangify/docs/tutorial/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/tutorial/parsing-quickstart# 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yangify-0.1.1.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yangify-0.1.1-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file yangify-0.1.1.tar.gz.

File metadata

  • Download URL: yangify-0.1.1.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.14 CPython/3.6.7 Linux/4.15.0-47-generic

File hashes

Hashes for yangify-0.1.1.tar.gz
Algorithm Hash digest
SHA256 53a6c0a0c99c822028d59b69f4dbe25366ba824a8c23f198340e5a284d676d70
MD5 a68296163fab76637f1685df9ac5d393
BLAKE2b-256 eb21425210d4b293c16b6a5c46118e6106be1b503ce00f214dcb194bcfc8cdb1

See more details on using hashes here.

File details

Details for the file yangify-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: yangify-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.14 CPython/3.6.7 Linux/4.15.0-47-generic

File hashes

Hashes for yangify-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 775aa5203426acd96cd98cd0c8d4b63b4de07db036546d4da623bc7b51a3286c
MD5 e27234a03de4c56b73724089acd02468
BLAKE2b-256 87419bc8f635e74478bc68e14016e6a1c868fe2c823e433466c4f41cd18bb63f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page