ncclient is a Python library that facilitates client-side scripting and application development around the NETCONF protocol. The above Python snippet uses the ncclient to connect and establish a NETCONF session to a Nexus device (which is also a NETCONF server).