Home / The book

Python for Network Engineers

From CLI to automation, written for engineers who already run networks. Learn Netmiko, TextFSM, Jinja2, NETCONF, RESTCONF and Ansible, and finish with a project for your GitHub profile.

  • 12 chapters and 3 appendices, with exercises and worked answers
  • Code pack with every script, templates, sample data and offline tests
  • Examples for Cisco IOS, adaptable to other Netmiko vendors
₦70,000

PDF book and code pack. One payment.

Not sure yet? Read the free sample or ask a question on WhatsApp.

What you will be able to do

  1. Run a command on a router from Python

    Set up your lab, write your first script, and connect to a device with Netmiko.

    Chapters 2 to 5

  2. Turn CLI output into data you can question

    Parse show commands with TextFSM so a script can answer: which interfaces are down? show ip interface brief

    Chapter 6

  3. Generate configs from one YAML file

    Describe your network once and render a clean config for every router with Jinja2.

    Chapter 7

  4. Reach many devices at once

    Use a thread pool, handle devices that fail, and keep the load sensible.

    Chapter 8

  5. Make changes safely

    Back up, dry run, diff, verify, and know your rollback before you push anything.

    Chapter 9

  6. Try NETCONF, RESTCONF and Ansible

    Read structured data from the device and run your first playbook.

    Chapters 10 and 11

  7. Finish a pipeline you can put on GitHub

    YAML intent to rendered config, deployment, verification and an HTML report.

    Chapter 12

Inside the book

Chapter 1: The CLI Engineer's Unfair Advantage

Why your command-line knowledge is the foundation of automation, and what to automate first.

Chapter 2: Your Lab and Your First Script

Install Python, set up a virtual environment, and learn variables, lists and dictionaries.

Chapter 3: Functions: print vs return

Write reusable functions and finally understand parameters, with network examples.

Chapter 4: Lists, Loops and Your Device Inventory

Loop over devices and turn show-command text into decisions.

Chapter 5: Your First Netmiko Script

Log in over SSH, collect output from many devices, and handle failures properly.

Chapter 6: Parsing Output Properly

TextFSM and ntc-templates turn CLI text into structured data.

Chapter 7: Config Templates with Jinja2 and YAML

Generate consistent configs for any number of routers from one data file.

Chapter 8: Many Devices at Once

Thread pools, failures that do not stop the run, and sensible limits.

Chapter 9: Making Changes Safely

Backups, dry runs, diffs, verification and rollback thinking.

Chapter 10: NETCONF and RESTCONF

Read structured data straight from the device instead of scraping text.

Chapter 11: Ansible for Network Engineers

Inventories and playbooks, and when to choose Ansible over Python.

Chapter 12: Capstone: A Complete Automation Pipeline

A tool that renders, deploys, verifies and reports, ready for your GitHub profile.

Appendices

Common errors and fixes, a Python cheat sheet, and a 30-day plan.

A taste of the code

This runs on your laptop with no router. It reads the output of show ip interface brief and returns the interfaces whose protocol is down.

# Chapter 4
def find_down(output):
    down = []
    for line in output.splitlines()[1:]:
        parts = line.split()
        if parts[-1] == "down":
            down.append(parts[0])
    return down

# Result
['Gi0/1', 'Gi0/2']

What is in the package

  • The book as a PDF
  • The code pack as a ZIP
  • Bonus: the Enterprise Engineer Startup Kit (sold separately at ₦25,000)

Who it is for

  • CCNA and CCNP-level engineers who want to automate
  • Engineers who repeat the same commands on many devices
  • Anyone aiming at automation or remote roles

Who it is not for

  • Complete beginners to networking
  • Readers who want a general programming course
  • Anyone who needs live classes

About the author

Onyedikachi Onwe is a Lagos-based network and IT infrastructure specialist with more than seven years of enterprise networking experience and certifications from Cisco, Google and IBM. He wrote this book for the engineer he used to be: strong on the CLI, stuck on where to start with code.

More about the author

Want help after the book?

Mentorship gives you one-to-one review of your scripts and a plan for moving into automation roles.

Apply for mentorship

Questions

Do I need to know Python already?

No. The book starts with variables and builds up through functions, loops and files. If you can read a routing table, you can learn this.

Do I need real devices?

Chapters 1 to 4 need no devices at all. From Chapter 5 you connect to a lab device: GNS3, EVE-NG, Cisco Modeling Labs, the free Cisco DevNet sandbox, or spare hardware. Do not practise on production equipment.

Does it only cover Cisco?

The examples use Cisco IOS and IOS-XE. The same approach works with other vendors that Netmiko supports, such as Huawei VRP, by changing the device type.

What do I receive?

A PDF book with exercises and worked answers, and a code pack (a zip file) with every script, the templates, sample data and offline tests, so you can check your setup before touching a device.

How is this different from the Enterprise Engineer Startup Kit?

The Startup Kit is a career companion: roadmap, ten labs, a troubleshooting playbook and a job toolkit. Python for Network Engineers teaches the programming and automation skills in depth, chapter by chapter.

What if I get stuck?

Message us on WhatsApp with your question. If you want ongoing help with your scripts and your path into automation, apply for mentorship.

Is this a live course?

No. It is a self-paced book. Live cohorts have been replaced by books and one-to-one mentorship.

Learn the skill that sits on top of your CLI

PDF book, code pack and exercises. ₦70,000.

Get the book
Python for Network Engineers₦70,000, code pack included
Get the book