Network Automation with Python
Unlock the complete study guide + 1,040 practice questions across 16 full exams.
Bundled into the existing Designing, Deploying and Managing Network Automation Systems premium course — no separate purchase.
14-day money-back guarantee — no questions asked.
Included in this chapter:
- Four interfaces to a device: reach versus preference
- NETCONF with ncclient: candidate, commit, transaction
- RESTCONF with requests: HTTP plus a YANG media type
- CLI automation: netmiko on top of paramiko
- Concurrency with asyncio: overlap the waits
- Decorators: wrapping behavior around a function
- Packaging: pyproject.toml, wheels, and a venv
- What the exam stem looks like
The Python network-automation toolkit
| Task | Python tool | Interface / protocol | Reach for it when |
|---|---|---|---|
| Transactional config change | ncclient | NETCONF over SSH (port 830) | edits must apply atomically or roll back |
| Direct config edit | requests | RESTCONF over HTTPS | one JSON edit to running, no transaction needed |
| No API on the device | netmiko (on paramiko) | CLI over SSHv2 | screen-scrape when the feature is not modeled |
| Scale to a fleet | asyncio | any async-native transport | overlap hundreds of network waits, cap with a Semaphore |
| Reuse and ship the code | decorators, packaging | n/a (Python tooling) | cross-cutting logic + an installable console command |
Decision tree
Cheat sheet
Unlock with Premium — includes all practice exams and the complete study guide.
References
- https://datatracker.ietf.org/doc/html/rfc7950
- https://datatracker.ietf.org/doc/html/rfc6241
- https://datatracker.ietf.org/doc/html/rfc8040
- https://developer.cisco.com/
- https://docs.python.org/3/library/asyncio.html
- https://ncclient.readthedocs.io/en/latest/manager.html
- https://datatracker.ietf.org/doc/html/rfc6242
- https://developer.cisco.com/docs/ios-xe/
- https://requests.readthedocs.io/en/latest/
- https://requests.readthedocs.io/en/latest/user/quickstart/
- https://requests.readthedocs.io/en/latest/user/advanced/
- https://developer.cisco.com/docs/dna-center/
- https://datatracker.ietf.org/doc/html/rfc4253
- https://datatracker.ietf.org/doc/html/rfc4252
- https://datatracker.ietf.org/doc/html/rfc4254
- https://www.cisco.com/c/en/us/support/docs/security-vpn/secure-shell-ssh/4145-ssh.html
- https://docs.python.org/3/library/asyncio-eventloop.html
- https://docs.python.org/3/library/asyncio-task.html
- https://docs.python.org/3/library/asyncio-runner.html
- https://docs.python.org/3/library/asyncio-sync.html
- https://docs.python.org/3/glossary.html
- https://docs.python.org/3/library/multiprocessing.html
- https://docs.python.org/3/library/functools.html
- https://docs.python.org/3/library/importlib.metadata.html
- https://docs.python.org/3/library/venv.html
- https://docs.python.org/3/installing/index.html