Practical Python for Network Operations
Hands-on Automate, Administer and Validate Enterprise Networks using Python 3.14, NETCONF, Ansible, Nornir, gNMI and CI Pipelines
This book is not just a Python course with a networking flavour or a networking course with a few scripts attached. You already know how routing converges, why VLANs leak, and what a half-open TCP session looks like on the wire. What this book adds is the ability to transform that knowledge into code that runs across hundreds of devices, reports accurately on its findings and never makes changes that cannot be undone.
About
About the Book
In today's landscape, the success of enterprise networks hinges on proficiency in understanding how networks behave, and knowing how to optimise their performance at scale. Therefore, this book is written for professionals who already know the basics and want to learn about scaling up. Covering Python 3.14 as an everyday operations tool, this book is a must-read for network engineers, network and system administrators, network architects and enterprise architects. It teaches you to transform a basic reachability probe into a complete application which can audit routers, Linux hosts, cloud accounts, and Kubernetes clusters.
You will practically experience automating devices over SSH, NETCONF and RESTCONF; managing Linux networking through netlink, and switching from SNMP polling to gNMI streaming telemetry for monitoring. It covers everything from hardening firewalls, TLS and VPNs to building your own network API with FastAPI, managing configuration with NAPALM, Nornir, NetBox and Ansible, and validating every change in a CI pipeline with Batfish and pyATS before it reaches production. Each step is accompanied by a dry run and a rollback option, and every lab runs in containers on your own machine.
Key Learnings
- Build your Python 3.14 tooling, and choosing between free-threaded and standard builds.
- Automate multi-vendor devices using Netmiko and Scrapli.
- Parse device output using TextFSM, TTP and Genie over Regex.
- Apply safe changes using NETCONF candidate datastores, confirmed commits and automatic rollback.
- Manage Linux interfaces, routes and namespaces using netlink with pyroute2.
- Scale to hundreds of devices using asyncio TaskGroups, timeouts and semaphores.
- Replace SNMP polling with gNMI streaming telemetry for Prometheus and OpenTelemetry.
- Automate firewalls, TLS audits, WireGuard tunnels and CIS compliance checks.
- Drive configuration from NetBox through Nornir, Jinja2, NAPALM and Ansible.
- Validate changes in CI before production using Batfish, pyATS and Containerlab.
Table of Content
- Building Python 3.14 Network Toolkit
- Probing Networks with Raw Sockets
- Talking to HTTP, DNS and WebSocket Services
- Automating Network Devices over SSH
- Configuring Devices with NETCONF, RESTCONF and YANG
- Managing Linux Host Networking
- Scaling Fleet Operations with Concurrency
- Monitoring Networks with Streaming Telemetry
- Securing Networks and Automation Credentials
- Building and Consuming Network APIs
- Managing Configuration across the Fleet
- Running Network Changes with Ansible
- Testing and Shipping Network Changes with CI/CD
- Auditing Cloud and Kubernetes Networks
Target Audience
To read this book, you don't need to be a seasoned networking professional. All you need is a sense of curiosity, access to a terminal, and a willingness to let the computer handle the repetitive tasks.
Feedback
Packages
Pick Your Package
All packages include the ebook in the following formats: PDF and EPUB
This book only
Minimum price
Suggested price$29.99$29.99
This book + Extras Downloadable (Python Networking 101, Second Edition)
Minimum price
Suggested price$52.99$47.99
- Python Networking 101, Second EditionPython Networking 101 Second Edition builds the foundations with Netmiko, Paramiko, and NAPALM.
This book is also available in the following packages:
This book + Extras Downloadable (Mastering Python Network Automation)
No Description Available
- Mastering Python Network AutomationMastering Python Network Automation extends into container orchestration and infrastructure-wide automation.
- Minimum price
- $47.99
- Suggested price
- $52.99
- Mastering Python Network Automation
This book + Extras Downloadable (Learning Ansible)
No Description Available
- Learning AnsibleLearning Ansible rounds out the bundle with agentless configuration management and CI/CD integration.
- Minimum price
- $47.99
- Suggested price
- $52.99
- Learning Ansible
This book + Extras Downloadable (Python Networking 101 + Python Network Automation + Learn Ansible)
No Description Available
- Python Networking 101, Second EditionPython Networking 101 Second Edition builds the foundations with Netmiko, Paramiko, and NAPALM.
- Mastering Python Network AutomationMastering Python Network Automation extends into container orchestration and infrastructure-wide automation.
- Learning AnsibleLearning Ansible rounds out the bundle with agentless configuration management and CI/CD integration.
- Minimum price
- $77.99
- Suggested price
- $84.99
- Python Networking 101, Second Edition
Bundle
Bundles that include this book
Mastering NetDevOps

4 Books
- Pricing
$79.99
Minimum priceBought separately$119.96Suggested price$84.99
Author
About the Author
We are the engineer’s publisher, the coder’s mentor, and the content alchemist—meticulously turning dense tech into practical gold. With a growing library of 100+ titles, we don’t just develop technical books, rather we build roadmaps for professionals across Python, MySQL, DevOps, Rust, AI, Kotlin, Arduino, Golang and everything around the massive IT ecosystem. Every chapter, every script, every project is a tool in the hands of developers who want to get things done.
Where others summarize, we construct step-by-step learning blueprints, cutting through clutter, banning the fluff, and ensuring every paragraph delivers hands-on value. Our audience isn’t learning from scratch—they’re leveling up with purpose, and we stand by them with code-first content, consistent project workflows, and a zero-redundancy approach.
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Write and Publish on Leanpub
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.