Python for Network & Systems Engineers

Python for Network & Systems Engineers icon

Python for Network & Systems Engineers

About This Course

A working shell script is one thing. Tooling the rest of your team can read, review and safely re-run is another. This course is about the difference: idempotency, so a second run is not a gamble; command-line interfaces whose defaults make the safe action the easy one; logs that say what happened; and credentials kept somewhere other than the source file.

The three days build in order. Day 1 is the Python itself, so the course works as an entry point for people who have only scripted in Bash. Day 2 is operational data, because most automation starts with a question about logs, interfaces or metrics — and answering it in a DataFrame is faster than answering it in a pipeline of grep and awk. Day 3 builds the tools, moving from a local command-line utility to remote hosts over SSH, and then to automation exposed as an HTTP service that other systems and other teams can call.

We take the failure cases seriously, because they are the reason the scripts you have now are not trusted. Half a fleet updates and half does not. An API times out, or answers with a rate limit, or returns only part of what you asked for. A job dies two-thirds of the way through and someone has to work out whether running it again is safe. Exercises use realistic device and log output rather than toy data, and an API built to be unreliable on purpose. Where the delivery allows it, the Fabric exercises run against a live host you connect to over SSH.

An extended case study draws the techniques together across the last day. We work through one complete system — a service, a command-line client and the test suite that covers both — so you leave with a worked example to adapt, rather than a folder of isolated exercises.

Who This Course Is For

Network engineers, systems engineers, site reliability engineers, DevOps practitioners and back-end developers who automate recurring infrastructure work. It suits people who keep things running with shell scripts and SSH loops, and who have reached the point where those scripts are too important to be as fragile as they are.

It also suits teams where the automation is written by whoever was on shift, and where nobody else is confident enough to run it. Teams standardising on Python for operational tooling use the course to agree on how a tool should be structured, invoked and re-run.

Prerequisites

Some familiarity with programming concepts in any language is helpful, but prior programming experience is not required. You do not need to have written Python before: Day 1 covers the Python the rest of the course depends on.

You should be comfortable at a shell prompt and with SSH, since the automation we write drives real hosts. No web development experience is required: you will write the service in Day 3 in Python, and not write any HTML, CSS or JavaScript. If you already write Python daily, you may prefer to join from Day 2.

What You'll Learn

  • Build command-line automation tools, with safe defaults, that your colleagues can read and run without asking you first
  • Write idempotent automation, so a second run is safe and a partial failure can be resumed rather than restarted
  • Automate a fleet of remote hosts over SSH with Fabric, handling the hosts that fail while the rest succeed
  • Turn semi-structured device and log output into tabular data you can query, summarise and chart
  • Call REST APIs reliably against services that time out, rate-limit or return partial results
  • Expose your automation as an HTTP service with FastAPI that other systems can call

Course Syllabus

Day 1 — Python for people who script

  • Core language features: variables, conditions, loops and functions
  • Essential data types: lists, dictionaries, tuples and sets
  • Counting and grouping log events with Counter and defaultdict
  • Reading and writing files, and working with paths
  • Structuring code across modules and packages

Day 2 — Handling and presenting operational data

  • Analysing operational data with Polars: filtering, selecting and chaining
  • Aggregating and reshaping: group-by, window functions, pivots and joins
  • Working with dates and times in operational data
  • Reading and writing CSV, Excel, Parquet, JSON and SQL databases
  • Visualisation with Plotly Express: distributions, faceting and maps

Day 3 — Automation, and exposing it to your team

  • Structuring an automation project with uv, so your team can maintain it
  • Building command-line tools with Typer, and the --dry-run/--apply pattern
  • Idempotent automation, checkpoints and recovering from partial failures
  • Logging what happened, and keeping credentials out of the source file
  • Parsing device output into structured data with regular expressions and TextFSM
  • Calling REST APIs reliably: timeouts, retries with backoff, and authentication
  • Remote automation across many hosts over SSH with Fabric
  • Exposing automation as a service with FastAPI

Further topics, including packet capture and network address handling, are available for private deliveries of this course.

Upcoming Sessions

Questions?

Need help choosing the right course or have questions about content?

Contact Us