1Install
2-------
3In this directory run:
4
5  python setup.py install
6
7(this might require root access)
8
9
10To install in a different location, run:
11
12  python setup.py install --prefix=/usr/local
13
14If you do this, it is recommended to set the environment variable
15YANG_INSTALL to the prefix directory.  This ensures that pyang will
16find standard YANG modules. In addition, make sure that PYTHONPATH is set
17to something as follows:
18
19export PYTHONPATH=/usr/local/lib/python2.7/site-packages
20
21or whatever version of python you are running.
22
23
24Run locally without installing
25------------------------------
26export PATH=`pwd`/bin:$PATH
27export MANPATH=`pwd`/man:$MANPATH
28export PYTHONPATH=`pwd`:$PYTHONPATH
29export YANG_MODPATH=`pwd`/modules:$YANG_MODPATH
30export PYANG_XSLT_DIR=`pwd`/xslt
31export PYANG_RNG_LIBDIR=`pwd`/schema
32
33or:
34
35source ./env.sh
36
37
38Usage
39-----
40pyang -h
41man pyang
42
43
44Code structure
45--------------
46
47bin/
48  Executable scripts.
49
50pyang/
51  Contains the pyang library code.
52
53pyang/__init__.py
54  Initialization code for the pyang library.
55  Defines the Context and Repository classes.
56
57pyang/syntax.py
58  Generic syntax checking for YANG and YIN statements.
59  Defines regular expressions for argument checking of core
60  statements.
61
62pyang/grammar.py
63  Generic grammar for YANG and YIN.
64  Defines chk_module_statements() which validates a parse tree
65  according to the grammar.
66
67pyang/statements.py
68  Defines the generic Statement class and all validation code.
69
70pyang/yang_parser.py
71  YANG tokenizer and parser.
72
73pyang/yin_parser.py
74  YIN parser.  Uses the expat library for XML parsing.
75
76pyang/types.py
77  Contains code for checking built-in types.
78
79pyang/plugin.py
80  Plugin API.  Defines the class PyangPlugin which all plugins
81  inherits from. All output handlers are written as plugins.
82
83pyang/plugins/
84  Directory where plugins can be installed.  All plugins in this
85  directory are automatically initialized when the library is
86  initialized.
87
88pyang/translators/
89  Contains output plugins for YANG, YIN, XSD, and DSDL translation.
90
91xslt
92  Contains XSLT style sheets for generating RELAX NG, Schematron and
93  DSRL schemas and validating instance documents. Also included is the
94  free implementation of ISO Schematron by Rick Jelliffe from
95  http://www.schematron.com/ (files iso_schematron_skeleton_for_xslt1.xsl,
96  iso_abstract_expand.xsl and iso_svrl_for_xslt1.xsl).
97
98schema
99  Contains RELAX NG schemas and pattern libraries.
100