Skip to main content

A project for generating YANG tree views.

Project description

YANG Documentation Viewer

Very limited YANG Documentation generator based on libyang, with similar output to that of pyang -f jstree. The default output is a standalone HTML file, called yangdoc.html, that can be included in documentation bundles.

Usage

See below setup instructions first.

~/src/yangdoc(main)$ python main.py -p yang -m ietf-system -e authentication -e local-users -e ntp -e ntp-udp-port -e timezone-name -m ietf-interfaces -e if-mib
INFO: Parsing ietf-system, enabling features: ['authentication', 'local-users', 'ntp', 'ntp-udp-port', 'timezone-name']
WARNING: Warning: failed to parse module: Data model "ietf-netconf-acm" not found in local searchdirs.: Loading "ietf-netconf-acm" module failed.: Parsing module "ietf-system" failed.
INFO: Parsing ietf-interfaces, enabling features: ['if-mib']
INFO: Processing module ietf-interfaces
INFO: HTML file generated: yangdoc.html
x-www-browser yang_tree_view.html
~/src/yangdoc(main)$ x-www-browser yang_tree_view.html

Screenshot

Setup

These instructions have been tested on Linux Mint 21.3, but are mostly the same for other operating systems.

Clone the repository to your home directory:

~$ cd src/
~/src$ git clone https://github.com/troglobit/yangdoc
~/src$ cd yangdoc
~/src/yangdoc(main)$

Set up your virtual environment, this ensures all python packages installed from requirements.txt are installed only in .venv/:

~/src/yangdoc(main)$ python -m venv .venv
~/src/yangdoc(main)$ source .venv/bin/activate

Install all required packages:

~/src/yangdoc(main)$ sudo apt install libyang2
~/src/yangdoc(main)$ pip install -r requirements.txt

Developer Notes

Use pip-compile from pip-tools to [manage Python requirements][4], this makes life a lot easier since we only need pyproject.toml for all our packaging needs.

To install locally, or just build, verifying pyproject.toml:

~/src/yangdoc(main)$ pip install -e .
~/src/yangdoc(main)$ python -m build

For uploading to PyPi, remember to install twine:

~/src/yangdoc(main)$ pip install twine

Then build and test upload:

~/src/yangdoc(main)$ python -m build
~/src/yangdoc(main)$ twine upload --repository-url https://test.pypi.org/legacy/ dist/*

Verify upload and then upload to PyPi proper:

~/src/yangdoc(main)$ twine upload dist/*

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

yangdoc-0.6.0.tar.gz (117.1 kB view details)

Uploaded Source

Built Distribution

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

yangdoc-0.6.0-py3-none-any.whl (114.9 kB view details)

Uploaded Python 3

File details

Details for the file yangdoc-0.6.0.tar.gz.

File metadata

  • Download URL: yangdoc-0.6.0.tar.gz
  • Upload date:
  • Size: 117.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for yangdoc-0.6.0.tar.gz
Algorithm Hash digest
SHA256 57867b9466c17629d0f3f4266a0dcb9b95e0d55bdc8a4f9b37ed23d89b54cea7
MD5 1b48065f3ceab3d05016c3fcba0319e5
BLAKE2b-256 a735b9770953d7e42a6e2a2f0a88f79656610f4e36b33946cd957c5d7d55824d

See more details on using hashes here.

File details

Details for the file yangdoc-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: yangdoc-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 114.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for yangdoc-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68e6047eebf8e1be76112e6dfbef35f0d6b05708838efd5d58283ec4214da54c
MD5 c5450ff074497f5dd5f4dcb933e77147
BLAKE2b-256 1af150cfe1c28975a8ec9d2505a973f945a955dad7c32e736b2d5649b58b21e8

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