Python Network Automation Libraries


1.Paramiko, Netmiko - to ssh into device and execute CLI commands

2.pyang (Browse YANG- Data Modeling)

3.request - For RESTCONF (REST+YANG ) (GET,PUT,POST,DELETE)

4.ncclient (NETCONF - to program device using netconf interface- YANG model)

5.pygnmi (capability, get, set, subscribe)

HTTP Method     gNMI/NETCONF       EquivalentDescription
GET                     get                           Read configuration/state
POST                   create                       Create new config
PUT                     replace                      Replace config
PATCH                 update                       Update config partially
DELETE                delete                        Remove config


REST Async

An asynchronous REST call means:
Python does NOT wait for one HTTP request to finish before starting another.
Instead of:
Call API → wait → get response → next call
Async does:
Call API → move on → call another API → come back when responses are ready


*** In async Python, each REST request runs in its own coroutine, and the event loop schedules them so that faster responses are handled immediately while slower ones don’t block others

What is asynchronous execution? How is it different from synchronous?
Async = start a task and don’t wait for it to finish immediately.
Sync = wait for task to finish before continuing.
Example: Telecom provisioning → API returns “ACCEPTED”, actual state becomes ACTIVE after a few minutes.
In Robot → handled via polling/retries.  (Wait Until Keyword Succeeds)
In Python → handled via async/await or event-driven callbacks. (async def + await)