An extensible YANG validator and converter in python
Clone or download
Latest commit 48e6d58 Jan 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin revert change of Repository.get_module_from_handle signature Jan 18, 2019
doc Update man page to include the --transform option Dec 18, 2018
etc/bash_completion.d Add documentation for new switch Aug 29, 2018
man/man1 updated for 1.7.8 release Jan 21, 2019
modules added ietf modules Jan 15, 2019
pyang updated for 1.7.8 release Jan 21, 2019
schema DSDL: fix __anyxml__ named pattern. Dec 10, 2014
test handle multiple augments of the same target in check_update Jan 19, 2019
tools/images Add bash completion for yang2dsdl and json2xml. Dec 21, 2014
uml-utilities UML utilities Feb 16, 2011
xslt Fix #360 Jan 30, 2018
.gitignore updated gitignore for test output Jan 17, 2019
.travis.yml disable python 3.5 in travis Aug 28, 2018
CHANGES updated for 1.7.6 release Jan 17, 2019
CONTRIBUTING.md added CONTRIBUTING Oct 11, 2018
LICENSE preparing for 1.7.2 Jun 14, 2017
MANIFEST.in Include data files in source distribution tarball Sep 30, 2016
Makefile Include data files in source distribution tarball Sep 30, 2016
PIP-INFO pyang 1.7.1 release Nov 2, 2016
README Updated the error message on canonical ordering to reference the RFC … Jul 1, 2015
README.md updated for 1.7.8 release Jan 21, 2019
TODO updated CHANGES with warning for unsafe quoted strings Jun 8, 2017
env.sh Set yang2dsdl env variables in env.sh; prefixed the vars with PYANG_ Mar 16, 2010
requirements.txt enabling test of python3 w/ travis Oct 5, 2015
setup.cfg Fixes #128,#134 - use pypi Oct 6, 2015
setup.py fixing pyang.bat on Windows Jan 10, 2019

README.md

Build Status Coverage Status

News

2019-01-21 - Version 1.7.8 released

  • reverted method signature change for Repository.get_module_from_handle(). it now has the same signature as in 1.7.5.

  • fixed bug in check_update when there were more than one augment for the same target node.

2019-01-17 - Version 1.7.7 released

  • fixed a bug in -f yang formatting

See below for previous releases.

2019-01-17 - Version 1.7.6 released

  • better formatting of YANG modules with -f yang

  • new type of plugin ("transform") to make transformations on the representation of the YANG module

  • ... and various other enhancements and bug fixes, see CHANGES.

See below for previous releases.


Overview

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

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 generate code from the modules.

Installation

Pyang can be installed from PyPI:

# pip install pyang

Compatibility

pyang is compatible with the following IETF RFCs:

Features

  • Validate YANG modules.
  • Convert YANG modules to YIN, and YIN to YANG.
  • Translate YANG data models to DSDL schemas, which can be used for validating various XML instance documents. See InstanceValidation.
  • Translate YANG data models to XSD.
  • Generate UML diagrams from YANG models. See UMLOutput for an example.
  • Generate compact tree representation of YANG models for quick visualization. See TreeOutput for an example.
  • Generate a skeleton XML instance document from the data model.
  • Schema-aware translation of instance documents encoded in XML to JSON and vice-versa. See XmlJson.
  • Plugin framework for simple development of other outputs, such as code generation.

Documentation

See Documentation.


Previous releases

2018-04-25 - Version 1.7.5 released

  • tree plugin updated to align with RFC 8340

  • better formatting of YANG modules with -f yang

  • reduced memory usage

  • ... and various other enhancements and bug fixes, see CHANGES.

2018-02-23 - Version 1.7.4 released

  • tree plugin updated to align with draft-ietf-netmod-yang-tree-diagrams-05

  • ... and various other enhancements and bug fixes, see CHANGES.

2017-06-27 - Version 1.7.3 released

  • Handle multiple rc:yang-data statements. This bug caused validation of ietf-restconf, or any module that imported ietf-restconf, to fail.

2017-06-14 - Version 1.7.2 released

  • Added support for external plugins, using setuptools entry_points, with the entry point "pyang.plugin".

  • ... and various other enhancements and bug fixes, see CHANGES.

2016-11-02 - Version 1.7.1 released

  • This is mainly a bug fix release, see CHANGES for details.

2016-06-16 - Version 1.7 released

  • Support for YANG 1.1, with the exception of the new submodule scoping rules.

2015-10-06 - Version 1.6 released

  • pyang can now be installed via PyPi.

  • A new plugin 'lint' has been added. It checks if a module follow the generic guidelines defined in RFC 6087. The 'ietf' plugin still exists, but is rewritten to use the new 'lint' plugin.

  • By default, pyang now scans the YANG module path recursively, i.e., it searches for YANG modules also in subdirectories to the directories in the load path. This behavior can be disabled with '--no-path-recurse'.

  • A bash completions file has been added.

  • ... and various other enhancements and bug fixes, see CHANGES.

2014-11-18 - Version 1.5 released

  • A new plugin 'check-update' has been added. It can be used to check if a new revision of a module follows the update rules from RFC 6020.

  • A new plugin 'omni' has been added. It generates an OmniGraffle script file from a model.

  • ... and various other enhancements and bug fixes.

2013-11-11 - Version 1.4.1 released

  • Exactly as 1.4, but fixed to that it works with Python 3.

2013-10-24 - Version 1.4 released

  • lots of bugfixes

2013-01-31 - Version 1.3 released

  • New plugins: hypertree, jstree, jsonxsl, jtox
  • lots of bugfixes

2011-07-27 - Version 1.2 released

2011-02-16 - Version 1.1 released

  • A new UML plugin has been added. It is used to generate UML diagrams for visualization of YANG data models. See UMLOutput for an example.
  • The DSDL plugin is updated to RFC 6110
  • ... and various bug fixes.