1- Install ncclient
2- Example:
1- Install ncclient
https://github.com/ncclient/ncclient
...
sudo apt-get install libxml2-dev libxslt1-dev
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
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