1- Install ncclient
2- Example:
1- Install ncclient
https://github.com/ncclient/ncclient
If you are on Debian/Ubuntu install the following libs (via aptitude or apt-get):
sudo apt-get install libxml2-dev libxslt1-dev
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
sudo apt install python3-pip
sudo pip install ncclient
Successfully built cryptography
Installing collected packages: cryptography, bcrypt, paramiko, ncclient
Successfully installed bcrypt-3.1.3 cryptography-1.9 ncclient-0.5.3 paramiko-2.2.1
2- Example:
https://forums.juniper.net/t5/Automation/Async-NETCONF-RPC-example-with-ncclient/ta-p/308604