GitHub - mbj4668/pyang: An extensible YANG validator and converter in python (original) (raw)

pyang

Release Build Status

Overview

pyang is a YANG validator, transformator and code generator, written in python. It can be used to validate YANG modules for correctness, to transform YANG modules into other formats, and to write plugins to generate code from the modules.

YANG (RFC 7950) is a data modeling language for NETCONF (RFC 6241), developed by the IETF NETMOD WG.

Documentation

See Documentation.

Installation

Pyang can be installed from PyPI:

It is reccomended to use a Python virtual environment

git clone https://github.com/mbj4668/pyang.git cd pyang pip install -e .

To install in a different location, run:

python setup.py install --prefix=/usr/local

If you do this, it is recommended to set the environment variableYANG_INSTALL to the prefix directory. This ensures that pyang will find standard YANG modules. In addition, make sure that PYTHONPATH is set to something as follows:

export PYTHONPATH=/usr/local/lib/python3.10/site-packages

or whatever version of python you are running.

Run locally without installing

export PATH=pwd/bin:$PATH export MANPATH=pwd/man:$MANPATH export PYTHONPATH=pwd:$PYTHONPATH export YANG_MODPATH=pwd/modules:$YANG_MODPATH export PYANG_XSLT_DIR=pwd/xslt export PYANG_RNG_LIBDIR=pwd/schema

or:

Compatibility

pyang is compatible with the following IETF RFCs:

Features

Usage

or

Code structure