Skip to main content

ncs-yang is the smartway to compile yang file/files along with it's dependencies from Makefile.

Project description

ncs-yang

License: Apache 2.0 Version: 1.1.1 Downloads Downloads

ncs-yang is a simple tool to compile yang files using ncsc. By compiling only the required yang files makes the developer simplier and faster to develop yang files.

Introduction

When I was working with big projects to compile a simple yang it use to take long time due to make clean all compiles all the yangs persent in the given package. When looked in I was able to compile a single yang file with dependencies, which boosted me to make this lib to help other NSO developers.

It makes life simplier and easier to compiles only required yang files then all of them. in the big projectsIn the process we collect Makefile dependences and compile it for you.

Pre-requisites

  • ncsc command must be reconginsed by the terminal.
  • ncs-yang supports both trains of python 2.7+ and 3.1+, the OS should not matter.

Installation and Downloads

The best way to get ncs-yang is with setuptools or pip. If you already have setuptools, you can install as usual:

python -m pip install ncs-yang
pip install ncs-yang

Otherwise download it from PyPi, extract it and run the setup.py script

python setup.py install

If you're Interested in the source, you can always pull from the github repo:

  • From github git clone https://github.com/kirankotari/ncs-yang.git

Features

  • running single yang file
⋊> ~/k/i/cfs-package on sprint $ ncs-yang src/yang/cfs-mpls.yang
[ INFO ] :: [ ncs-yang ] :: compiling yang file: src/yang/cfs-mpls.yang
 /opt/ncs/ncs-5.2.1.2/bin/ncsc `ls cfs-mpls-ann.yang > /dev/null 2>&1 && echo "-a cfs-mpls-ann.yang"` --yangpath /opt/ncs/ncs-run/packages/cfs-package/src/../../common/src/yang --yangpath /opt/ncs/ncs-run/packages/cfs-package/src/../../resource-manager/src/yang -c -o /opt/ncs/ncs-run/packages/cfs-package/load-dir/cfs-mpls.fxs src/yang/cfs-mpls.yang
  • running multiple yang files
⋊> ~/k/i/cfs-package/src/yang on sprint $ ncs-yang cfs-mpls.yang cfs-asa.yang
[ INFO ] :: [ ncs-yang ] :: compiling yang file: cfs-mpls.yang
 /opt/ncs/ncs-5.2.1.2/bin/ncsc `ls cfs-mpls-ann.yang > /dev/null 2>&1 && echo "-a cfs-mpls-ann.yang"` --yangpath /opt/ncs/ncs-run/packages/cfs-package/src/../../common/src/yang --yangpath /opt/ncs/ncs-run/packages/cfs-package/src/../../resource-manager/src/yang -c -o /opt/ncs/ncs-run/packages/cfs-package/load-dir/cfs-mpls.fxs cfs-mpls.yang
[ INFO ] :: [ ncs-yang ] :: compiling yang file: cfs-asa.yang
 /opt/ncs/ncs-5.2.1.2/bin/ncsc `ls cfs-asa-ann.yang > /dev/null 2>&1 && echo "-a cfs-asa-ann.yang"` --yangpath /opt/ncs/ncs-run/packages/cfs-package/src/../../common/src/yang --yangpath /opt/ncs/ncs-run/packages/cfs-package/src/../../resource-manager/src/yang -c -o /opt/ncs/ncs-run/packages/cfs-package/load-dir/cfs-asa.fxs cfs-asa.yang

Help

⋊> ~/k/i/ncs-yang on master $ ncs-yang --help

ncs-yang
    <filename.yang>
    <path-to-filename.yang>
    -h | --help
    -v | --version

FAQ

  • Question: Do I need to install ncsc too?
    Answer: Not really, ncsc tool comes along with NSO. If you are working with NSO it's won't be a problem.

  • Question: Is python mandatory for ncsc?
    Answer: Yes, the library is written in python and we wanted not to be dependend on NSO versions.

  • Question: I am seeing an error?
    Answer: Error might be related to yang file, we recommend to check again beforing opening a bug.

Bug Tracking and Support

  • Please report any suggestions, bug reports, or annoyances with ncs-yang through the Github bug tracker.

License and Copyright

Author and Thanks

ncs-yang was developed by Kiran Kumar Kotari, For any suggestions or comments contact kkotari@cisco.com or kirankotari@live.com. If you find any bugs please fix them and send me a pull request.

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

ncs-yang-1.1.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

ncs_yang-1.1.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file ncs-yang-1.1.1.tar.gz.

File metadata

  • Download URL: ncs-yang-1.1.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.9

File hashes

Hashes for ncs-yang-1.1.1.tar.gz
Algorithm Hash digest
SHA256 6919b5c8a94efe90b1e145f42bba4230a41eb3619514440c713885e0d64f8323
MD5 98ecf8bd8025de488da0bf1d27e82c80
BLAKE2b-256 bf870e177ebca9147b0a0bc097174760ec338561a151cf7a3d4246c1b6ea6dde

See more details on using hashes here.

File details

Details for the file ncs_yang-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: ncs_yang-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.9

File hashes

Hashes for ncs_yang-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cc4130448502a326e26200a4daf1651ea65073c9be4a74e49deb1448e6d6388b
MD5 ee1254a31f3591037c3b4796ea930232
BLAKE2b-256 4605d5efb20a5b40a8b4e19faa949e02804ae9b0a29dc2bd29fe4208d6f9361f

See more details on using hashes here.

Supported by

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