THEORY · TH-PY-008
CCIE Automation v1.2 topic 1.1 asks you to compare, evaluate and recommend a network automation solution based on business and technical factors, and its item 1.1.c names three Python frameworks: Nornir, Netmiko and Scrapli. AUTOCOR 1.5 asks the same kind of question one level up: choose between an infrastructure as code framework, low code/no code and custom applications. TH-PY-005 and TH-PY-006 taught how each library works. This page is about the decision: what each one really is, the same job written four ways and measured, the technical and business criteria that decide, and how to write a recommendation that survives a review.
BLUEPRINT · AUTOCOR 350-901 v2.0: 1.4, 1.5 · CCIE Automation v1.2: 1.1
Jump to: What you are really comparing · The same job · Technical factors · Business factors · A decision guide · One level up · Writing the recommendation (CCIE 1.1) · What the exam expects · Exam check · References
Prerequisites: TH-PY-005 (Netmiko and Scrapli) and TH-PY-006 (Nornir).
What you will be able to do after this page
- Place Netmiko, Scrapli and Nornir in the right layer and explain why “Netmiko or Nornir” is often the wrong question.
- Write the same multi-device job with each option and explain where the speed comes from.
- Evaluate the options against technical factors (platforms, concurrency, transports, parsing, failure handling, testing, API stability).
- Evaluate them against business factors (team skills, scale, time to deliver, support, licensing, dependency risk).
- Decide when a Python framework is the right approach at all, against IaC tools and low-code workflows (AUTOCOR 1.5).
- Write a recommendation with requirements, choice, justification and risks (CCIE 1.1).
SECTION 1
What you are really comparing
The three names are not three alternatives at the same level. Two are connection libraries; the third is a framework that uses them:
| Netmiko | Scrapli | Nornir | |
|---|---|---|---|
| What it is | Library: one SSH session to one device, CLI in and text out | Library: one session to one device, sync or asyncio | Framework: inventory, task runner and results for many devices |
| Its own description (PyPI) | “Multi-vendor library to simplify CLI connections to network devices” | “Fast, flexible, sync/async … screen scraping client specifically for network devices” | “Pluggable multi-threaded framework with inventory management to help operate collections of devices” |
| Talks to devices through | Paramiko (SSH) | A pluggable transport: system (OpenSSH), paramiko, ssh2, asyncssh, telnet, asynctelnet | Plugins: nornir_netmiko, nornir_scrapli, NAPALM and others; Nornir 3 ships with no plugins |
| Platforms | 175 SSH device_type values in Netmiko 4.8.0, Cisco IOS XE as cisco_xe | Five core platforms (IOS XE, IOS XR, NX-OS, EOS, Junos), more in scrapli_community | Whatever the plugin supports |
| Many devices at once | Your code (threads) | Your code (threads or asyncio) | Built in: threaded runner, num_workers |
| Structured output | use_textfsm, use_genie, use_ttp | textfsm_parse_output(), genie_parse_output(), ttp_parse_output() | Same as the plugin used |
| License, Python (versions on this page) | MIT, Python 3.10+ (4.8.0) | MIT, Python 3.9+ (2025.1.30) | Apache-2.0, Python 3.10+ (3.6.1) |
So the realistic choices are: Netmiko alone, Scrapli alone, Nornir with Netmiko, or Nornir with Scrapli. Nornir answers “how do I run this on 500 devices and know what happened on each one”; Netmiko and Scrapli answer “how do I talk to this device”.
TRAP
Scrapli has two generations on PyPI. The classic API (2025.1.30 and earlier) is the one nornir_scrapli 2025.1.30 needs; the 2026.x releases moved to a new API on top of libscrapli and break that plugin on import (TH-PY-005). “Choose Scrapli” in a design document must say which one, and pin it.
SECTION 2
The same job, four ways
The job: run show version on three routers and return the parsed software version of each. This is the code, tested against three simulated IOS XE devices that take 2 seconds to answer the command:
"""The same job four ways: `show version` on every router, parsed with TextFSM (TH-PY-008)."""
from __future__ import annotations
import asyncio
import os
import sys
import time
from concurrent.futures import ThreadPoolExecutor
HOSTS = ["192.0.2.11", "192.0.2.12", "192.0.2.13"]
USER, PASSWORD = os.environ["CLI_USER"], os.environ["CLI_PASS"]
# A. Netmiko, one device after another
def netmiko_one(host: str) -> str:
from netmiko import ConnectHandler
with ConnectHandler(
device_type="cisco_xe", host=host, username=USER, password=PASSWORD
) as conn:
return conn.send_command("show version", use_textfsm=True)[0]["version"]
def a_netmiko_serial() -> list[str]:
return [netmiko_one(h) for h in HOSTS]
# B. Netmiko with a thread pool: concurrency is your code
def b_netmiko_threads() -> list[str]:
with ThreadPoolExecutor(max_workers=10) as pool:
return list(pool.map(netmiko_one, HOSTS))
# C. Scrapli asyncio: one event loop, many sessions
async def scrapli_one(host: str) -> str:
from scrapli.driver.core import AsyncIOSXEDriver
async with AsyncIOSXEDriver(
host=host, auth_username=USER, auth_password=PASSWORD, transport="asyncssh"
) as conn:
resp = await conn.send_command("show version")
return resp.textfsm_parse_output()[0]["version"]
def c_scrapli_async() -> list[str]:
async def main() -> list[str]:
return list(await asyncio.gather(*(scrapli_one(h) for h in HOSTS)))
return asyncio.run(main())
# D. Nornir + nornir_netmiko: inventory, runner and results come with the framework
def d_nornir() -> list[str]:
from nornir import InitNornir
from nornir_netmiko.tasks import netmiko_send_command
nr = InitNornir(
runner={"plugin": "threaded", "options": {"num_workers": 10}},
inventory={
"plugin": "SimpleInventory",
"options": {"host_file": "hosts.yaml", "group_file": "groups.yaml"},
},
logging={"enabled": False},
)
nr.inventory.defaults.username, nr.inventory.defaults.password = USER, PASSWORD
try:
res = nr.run(task=netmiko_send_command, command_string="show version", use_textfsm=True)
finally:
nr.close_connections()
if res.failed:
raise RuntimeError(f"failed hosts: {sorted(res.failed_hosts)}")
return [res[h][0].result[0]["version"] for h in sorted(res)]
if __name__ == "__main__":
for name, fn in [
("A netmiko serial", a_netmiko_serial),
("B netmiko threads", b_netmiko_threads),
("C scrapli asyncio", c_scrapli_async),
("D nornir threaded", d_nornir),
]:
start = time.perf_counter()
versions = fn()
print(f"{name:18} {time.perf_counter() - start:5.1f} s {versions}")
sys.exit(0)
Measured over three runs:
| Approach | Command takes 2 s | Command takes ~0 s |
|---|---|---|
| A. Netmiko, serial | 7.3–7.5 s | 1.5 s |
| B. Netmiko, thread pool | 2.4–2.5 s | 0.5 s |
| C. Scrapli, asyncio | 2.4 s | 0.4–0.5 s |
| D. Nornir + Netmiko, threaded | 2.6 s | 0.5–0.6 s |
Read the numbers carefully:
- The big difference is serial versus concurrent, not one library versus another. Three devices that each take 2.5 s cost 7.5 s in a loop and about 2.5 s in parallel, with any of B, C or D.
- Once the job is concurrent, the libraries are within a fraction of a second of each other on this test. Claims that one library is “faster” need a measurement on your devices, your commands and your transport.
- These are simulated devices on one host. Real numbers depend on the device CPU, the AAA server and the network, which is why the CML checklist repeats the test.
What the numbers do not show is often what decides:
| Concern | A / B (Netmiko alone) | C (Scrapli asyncio) | D (Nornir) |
|---|---|---|---|
| A fourth router does not answer | A and B stop with NetmikoTimeoutException unless you catch it per host | gather raises ScrapliConnectionError for the whole job; with return_exceptions=True you get three versions and one exception | The run continues; R4 is in res.failed_hosts and skipped by later runs (TH-PY-006) |
| Where the device list lives | A Python list or your own file | Same | Inventory files with groups, defaults and filters |
| Credentials, platform per group | Your code | Your code | Inventory defaults and connection_options |
| Per-host result and change flag | Your code | Your code | AggregatedResult, MultiResult, Result |
SECTION 3
Technical factors
Use these questions when you compare the options for a real requirement:
| Factor | Question to ask | Where the options differ |
|---|---|---|
| Platform coverage | Does it support every OS in scope, with the right prompts and paging? | Netmiko has the widest list (175 SSH device types); Scrapli core has five platforms, the rest in community drivers |
| Concurrency model | How many devices, and does the rest of the application use asyncio? | Netmiko is synchronous (use threads); Scrapli offers the same API sync and async; Nornir gives threads managed for you |
| Transport and SSH features | Do you need OpenSSH config, jump hosts, specific ciphers or keys? | Scrapli’s system transport uses the OpenSSH binary and its config file; Netmiko uses Paramiko |
| Structured output | Which parser, and are there templates for the commands you need? | All use TextFSM, Genie or TTP; the template, not the library, decides (TH-PY-005) |
| Configuration changes | How are errors in config mode detected? | Netmiko send_config_set(error_pattern=...); Scrapli send_configs(failed_when_contains=...); Nornir uses the plugin’s task |
| Failure handling at scale | Must one dead device stop the job? | Only Nornir records per-host failures without extra code |
| Testing | Can you test without devices? | All can be mocked; Nornir tasks are plain functions that are easy to unit test |
| API stability | Will an upgrade break you? | Scrapli’s generation change breaks nornir_scrapli; pin versions in all cases (TH-PY-001) |
| Does a model-driven API exist? | Is CLI the right interface at all? | If the device offers RESTCONF or NETCONF for the feature, prefer it (TH-REST, TH-PY-007); CLI scraping is for what has no model |
SECTION 4
Business factors
The CCIE topic says “business and technical factors”. Business factors are not soft: they often decide.
| Factor | What to weigh |
|---|---|
| Team skills | A team that writes Python daily can own Nornir; a team that rarely codes is better served by an IaC tool or a workflow product (section 6) |
| Scale and frequency | A one-off read of five switches does not justify an inventory and a framework; a nightly job on 2,000 devices does |
| Time to deliver | Netmiko alone gives a working script in an hour; Nornir pays back when the second and third jobs reuse the same inventory |
| Support model | Netmiko, Scrapli and Nornir are open-source community projects, with no vendor support contract; if the organization needs one, Cisco products (pyATS, Network as Code, Crosswork, CCIE 1.1.a) or Ansible Automation Platform (1.1.b) change the answer |
| Licensing | MIT (Netmiko, Scrapli) and Apache-2.0 (Nornir) both allow commercial use; check the dependencies too (Paramiko is LGPL-2.1) |
| Dependency risk | Who maintains it, how often it releases, how breaking changes are announced; Nornir announced OpsMill as its new steward in June 2026, and Scrapli changed generation in 2026 |
| Fit with what exists | An existing Ansible estate, a CI pipeline, a source of truth: the new tool must plug into them |
SECTION 5
A decision guide

| Scenario | Recommendation | Why |
|---|---|---|
Read three show commands from five switches, once | Netmiko alone | Shortest path; no inventory to maintain |
| Nightly compliance on 2,000 IOS XE devices, results per device in a pipeline | Nornir + nornir_netmiko (or nornir_scrapli, pinned) | Inventory, filters, controlled num_workers, failed hosts reported per device |
| A FastAPI service (APP series) that runs CLI checks on demand | Scrapli asyncio | Same event loop as the web framework; no thread per device |
Access through a bastion host defined in ~/.ssh/config | Scrapli with the system transport | It uses OpenSSH and its configuration |
| Mixed estate with older or less common platforms | Netmiko (alone or under Nornir) | Widest device_type list |
| Configure VLANs, ACLs, OSPF on IOS XE 26.x | Not CLI: RESTCONF or NETCONF (TH-PY-007), possibly run by Nornir | Structured, validated, idempotent |
EXAM TIP
When a question asks for “the best” framework, look for the factor that decides: number of devices and need for an inventory (Nornir), asyncio (Scrapli), platform breadth (Netmiko), or the existence of a model-driven API (none of the three). An answer that names a library without tying it to a stated requirement is incomplete.
SECTION 6
One level up: which approach at all (AUTOCOR 1.5)
AUTOCOR 1.5 asks you to select the approach that meets technical and business requirements, among three families:
| Approach | Examples | Good fit | Weak fit |
|---|---|---|---|
| Infrastructure as code framework | Ansible (ANS series), Terraform and Cisco Network as Code (TF series) | Declarative desired state, reviewed in Git, teams that prefer YAML/HCL to code | Logic-heavy workflows, custom user interfaces |
| Low code / no code | Cisco Workflows in Cisco Cloud Control and the Meraki dashboard (“a modern low/no-code workflow designer”); the Crosswork Workflow Manager designer, a canvas with drag and drop | Operators who build and run workflows across Catalyst Center, SD-WAN, ISE and IT systems without writing code | Very custom logic, offline or air-gapped labs, fine-grained testing |
| Custom application | Python with Netmiko, Scrapli or Nornir; RESTCONF/NETCONF clients; an API of your own (APP series) | Unique logic, integration with internal systems, full control over tests and pipeline | Requires a team that develops, tests and maintains code |
Netmiko, Scrapli and Nornir are always the custom application branch. Choosing one of them already assumes that a custom application is the right approach; in a design question, justify that step first.
SECTION 7
Writing the recommendation (CCIE 1.1)
A recommendation that holds up in a review has four parts. An example for the nightly compliance job:
- Requirements. 2,000 IOS XE devices, read-only checks every night, results per device in the CI pipeline, TACACS+ authentication, team of three Python developers.
- Choice. Nornir 3.6.1 with
nornir_netmiko1.0.1 and Netmiko 4.8.0, TextFSM templates from ntc-templates, inventory generated from the source of truth. - Justification. Inventory and filters for 2,000 devices; per-host results and failure reporting without extra code;
num_workerssized to the AAA servers; Netmiko’scisco_xesupport and TextFSM templates for the commands in scope; open-source licenses compatible with internal use. - Risks and mitigations. Burst of logins on TACACS+ (measure and cap
num_workers); vty exhaustion (close connections infinally, one plugin per job); parser gaps on new IOS XE releases (raise_parsing_error=Trueand a test per template, TH-PY-005); community support only (pinned versions, internal owner for upgrades).
What the exam expects
- ✓ Explain the difference between connection libraries (Netmiko, Scrapli) and a framework (Nornir), and which combinations make sense (CCIE 1.1.c).
- ✓ Compare the options on technical factors: platforms, concurrency, transports, parsing, configuration errors, failure handling, testing, API stability.
- ✓ Compare them on business factors: skills, scale, time to deliver, support, licensing, dependency risk.
- ✓ Recognize when CLI automation is the wrong choice because a model-driven API exists.
- ✓ Select between IaC frameworks, low code/no code and custom applications for a requirement (AUTOCOR 1.5).
- ✓ Write a recommendation with requirements, choice, justification and risks (CCIE 1.1).
EXAM CHECK · 350-901 TOPIC 1.4
Read it like the exam
1. A colleague says “Nornir is faster than Netmiko”. In your measurements, a Netmiko loop over 300 devices takes 40 minutes and Nornir takes 3. Is the claim right?
Not as stated. Nornir with nornir_netmiko uses Netmiko underneath; the gain comes from running hosts in parallel with the threaded runner. Netmiko with a thread pool reaches similar times. The fair comparison is serial versus concurrent, and then which option gives inventory, results and failure handling for the effort.
2. A new internal portal built with FastAPI must run a few show commands on demand against IOS XE devices. Which option fits best, and why?
Scrapli with its asyncio driver (AsyncIOSXEDriver): it runs in the same event loop as the web framework, without a thread per device. Pin the classic API version if the portal will also use nornir_scrapli, and check whether RESTCONF covers the data first.
3. A design proposes Nornir with nornir_scrapli and scrapli unpinned in requirements.txt. What risk do you raise?
A fresh install pulls a 2026.x scrapli built on the new libscrapli API, and nornir_scrapli 2025.1.30 fails on import. Pin scrapli==2025.1.30 (and every other dependency), and test upgrades in the pipeline before production.
4. The requirement is to configure VLANs and ACLs on 200 Catalyst 9300 switches running IOS XE 26.x. A proposal uses Netmiko send_config_set with templates. What do you recommend instead, and what would you keep?
Use RESTCONF or NETCONF with the native models: structured bodies that can be validated offline, read-compare-change idempotency and clear errors (TH-PY-007). Nornir can still be kept as the runner and inventory for the 200 switches, calling a RESTCONF task instead of a CLI task.
5. Operations wants network engineers who do not code to build and run automations across Catalyst Center, SD-WAN and ISE, with approval steps. Is a Python framework the right approach?
Probably not as the primary tool. This is the low code/no code case of AUTOCOR 1.5: a workflow product such as Cisco Workflows (drag-and-drop designer, integrations with those platforms) fits the users and the requirement. Custom Python remains an option for logic the workflow tool cannot express.
References
- Cisco. Designing, Deploying and Managing Network Automation Systems v2.0 (350-901) exam topics
- Cisco. CCIE Automation Practical v1.2 exam topics
- Cisco. Cisco Agentic Workflows Data Sheet (Workflows in Cisco Cloud Control and the Meraki dashboard)
- Cisco. Crosswork Workflow Manager 2.1 Data Sheet
- PyPI. netmiko (4.8.0)
- PyPI. scrapli
- PyPI. nornir (3.6.1)
- Scrapli. Project details (transports, core platforms, sync and asyncio)