SlideShare a Scribd company logo
© Jeremy Schulman - 2018 - All Rights Reserved
Python for Network Engineers
Chapter 1
A Practical Guide for Getting Started
Jeremy Schulman
@nwkautomaniac
© Jeremy Schulman - 2018 - All Rights Reserved
Jeremy Schulman
● Software Engineer
● 20 Years in Industry
● Since 2012 exclusively focused
on "network automation"
● Other Roles:
○ Developer Advocate
○ Systems Engineer
○ Automation Architect
○ Open source contributor
@nwkautomaniac
Slides:
https://www.slideshare.net/
jeremyschulman
Github:
https://github.com/
jeremyschulman
© Jeremy Schulman - 2018 - All Rights Reserved
Obligatory Disclaimer
The views and opinions expressed in this presentation are Jeremy Schulman's and do not represent
any employer past or present.
Reference materials provided in this presentation, such as links to external training sites, do not
represent any form of recommendation.
© Jeremy Schulman - 2018 - All Rights Reserved
Network Engineers need to
competently use Python
so that they can make, and make use of,
power-tools that will improve their jobs.
These tools will not replace them.
© Jeremy Schulman - 2018 - All Rights Reserved
Agenda
● Discussion
○ Realistic expectations
○ Getting started
● Live coding
○ Jupyter Notebook - makes Python feel like a CLI
○ NetOps example exercises
● Where to go from here ...
© Jeremy Schulman - 2018 - All Rights Reserved
"Manual via CLI"
"SNMP based products"
"Vendor Products"
"SDN"
"Orchestration Systems"
"DevOps"
"Network Automation"
"Network Engineers
must become Software
Engineers"
Managing Networks
© Jeremy Schulman - 2018 - All Rights Reserved
"Manual via CLI"
"SNMP based products"
"Vendor Products"
"SDN"
"Orchestration Systems"
"DevOps"
"Network Automation"
"Network Engineers
must become Software
Engineers"
Managing Networks
© Jeremy Schulman - 2018 - All Rights Reserved
Learning any New Skill [1]
Novice Expert MasterCompetent Proficient
Experience over a long time
● Use everyday concrete experiences,
not abstract concepts
● Attaining core competency requires
instructor led training and / or
directed tutorials
Jeremy's key takeaways:
● Attaining proficient skill requires
experience and knowledge
that takes massive time investment
● Continuous mentorship, peer-review,
feedback, learning, experimentation
© Jeremy Schulman - 2018 - All Rights Reserved
Systems are Risky and Complex
Manage Distributed Network Services
High Risk
Complex
Tasks
Low Risk
Simple
Tasks
Configuration
Management
“config”
Situational
Awareness
“show”
Host-Only
(blast radius = 1)
Distributed System
(blast radius > 1)
© Jeremy Schulman - 2018 - All Rights Reserved
Where to start using Python
High Risk
Complex
Tasks
Low Risk
Simple
Tasks
Configuration
Management
“config”
Situational
Awareness
“show”
Host-Only
(blast radius = 1)
Distributed System
(blast radius > 1)
"Your network is a crime scene, and you
are the detective. You need better ways
to investigate what happened, and prove
guilt or innocence".
-- Jeremy
© Jeremy Schulman - 2018 - All Rights Reserved
Live Coding
Make Python *feel* like being on a CLI
http://jupyter.org/
© Jeremy Schulman - 2018 - All Rights Reserved
Jupyter Notebook
$ virtualenv playground
$ source playground/bin/activate
(playground)$ pip install ipython==5 jupyter
Setup a Python virtual-environment
(playground)$ pip install jupyter
Install Jupyter notebook for Python 2.7
Install Jupyter notebook for Python 3
© Jeremy Schulman - 2018 - All Rights Reserved
Jupyter Notebook
(playground)$ jupyter notebook
Start Jupyter notebook system, will launch browser
© Jeremy Schulman - 2018 - All Rights Reserved
Novice Topics
● Variables, duck-typing
● help(), type(), dir()
● pretty-printing
● Importing packages
● List, Dictionary
● Tuple, Set
● Functions
● For-loops
● If / Then / Else
● Working with files
● JSON, YAML files
● List Comprehensions
● Dictionary Comprehensions
● Set Comprehensions
● Collections - Counter
● Collections - defaultdict
© Jeremy Schulman - 2018 - All Rights Reserved
Python Libraries
● ipaddress
● tabulate
● first
● tqdm
● requests
● collections
● csv
● json
● yaml
● gtextfsm
● netmiko
● napalm
● lxml
● paramiko
● bidict
● operator
● itertools
● chain
© Jeremy Schulman - 2018 - All Rights Reserved
NetOps Examples
1. Use NAPALM drivers to execute device-specific CLI commands
a. Arista EOS
b. Cisco NX-OS
2. Process IP routing table information
3. Process LLDP neighbor information
4. Process Interface information
© Jeremy Schulman - 2018 - All Rights Reserved
Next Steps
● Take formal Python courses
● Global Knowledge
● Subscribe to Python News
○ Dan Bader
○ https://www.pythonweekly.com/
● https://www.python.org/
● Try PyCharm IDE
(Integrated Development Environment)
● Use Python every day
● Use Jupyter notebook
● Take industry classes
○ IpSpace
○ NetworkToCode
○ Kirk Byers
● Free Cisco DevNet
Building Novice Skills Building Competency
© Jeremy Schulman - 2018 - All Rights Reserved
Closing Thoughts
"A good network engineer is proficient at
quickly becoming competent."
-- Derick Winkworth (@cloudtoad)
● Be patient. Set realistic goals, both with yourself and
your management
● Consider how long it took you to become a Senior
Network Engineer
© Jeremy Schulman - 2018 - All Rights Reserved
Cheers!
Jeremy Schulman
@nwkautomaniac

More Related Content

Similar to Python for Network Engineers - A Practical Guide for Getting Started (20)

PDF
Python-for-DevOps-Learn-Ruthlessly-Effective-Automation-by-Noah-Gift_-Kennedy...
MinhTrnNht7
 
PDF
PyData Texas 2015 Keynote
Peter Wang
 
PDF
Learn To Code Like A Professional With Pythonan Open Source Versatile And Pow...
metalsmunshe
 
PDF
Python Essentials For Dummies John C Shovic Alan Simpson
cundyfema
 
PDF
High Performance Python 2nd Edition Micha Gorelick
danuzakhiem
 
PDF
Engineer Engineering Software
Yung-Yu Chen
 
PDF
Expert Python Programming - Second Edition Michał Jaworski
naterysandr
 
PDF
Research Software Engineering A Guide To The Open Source Ecosystem Matthias B...
kleksramble
 
PDF
(Ebook) High Performance Python by Micha Gorelick, Ian Ozsvald
gamvdbw117
 
PDF
High Performance Python 2nd Edition Micha Gorelick Ian Ozsvald
hunelibuzhan
 
PDF
Mastering Python Network Automation Tim Peters
ziqgufj0632
 
PPTX
Austin Python Learners Meetup - Everything you need to know about programming...
Danny Mulligan
 
PDF
Interop 2015: Hardly Enough Theory, Barley Enough Code
Jeremy Schulman
 
PDF
High Performance Python Practical Performant Programming for Humans 2nd Editi...
cemernania2a
 
PDF
Mastering Python Network Automation Tim Peters
quarinadityo
 
PDF
How to write a well-behaved Python command line application
gjcross
 
PPTX
Introduction to Python for Security Professionals
Andrew McNicol
 
PDF
Harmonic Stack for Speed
Yung-Yu Chen
 
PPT
Introduction to the intermediate Python - v1.1
Andrei KUCHARAVY
 
PDF
What is Python? (Silicon Valley CodeCamp 2015)
wesley chun
 
Python-for-DevOps-Learn-Ruthlessly-Effective-Automation-by-Noah-Gift_-Kennedy...
MinhTrnNht7
 
PyData Texas 2015 Keynote
Peter Wang
 
Learn To Code Like A Professional With Pythonan Open Source Versatile And Pow...
metalsmunshe
 
Python Essentials For Dummies John C Shovic Alan Simpson
cundyfema
 
High Performance Python 2nd Edition Micha Gorelick
danuzakhiem
 
Engineer Engineering Software
Yung-Yu Chen
 
Expert Python Programming - Second Edition Michał Jaworski
naterysandr
 
Research Software Engineering A Guide To The Open Source Ecosystem Matthias B...
kleksramble
 
(Ebook) High Performance Python by Micha Gorelick, Ian Ozsvald
gamvdbw117
 
High Performance Python 2nd Edition Micha Gorelick Ian Ozsvald
hunelibuzhan
 
Mastering Python Network Automation Tim Peters
ziqgufj0632
 
Austin Python Learners Meetup - Everything you need to know about programming...
Danny Mulligan
 
Interop 2015: Hardly Enough Theory, Barley Enough Code
Jeremy Schulman
 
High Performance Python Practical Performant Programming for Humans 2nd Editi...
cemernania2a
 
Mastering Python Network Automation Tim Peters
quarinadityo
 
How to write a well-behaved Python command line application
gjcross
 
Introduction to Python for Security Professionals
Andrew McNicol
 
Harmonic Stack for Speed
Yung-Yu Chen
 
Introduction to the intermediate Python - v1.1
Andrei KUCHARAVY
 
What is Python? (Silicon Valley CodeCamp 2015)
wesley chun
 

More from Jeremy Schulman (7)

PPTX
Network Config Backups - Netbox, Github, Ansible
Jeremy Schulman
 
PPTX
Automating "Network Ready for Use" with pytest
Jeremy Schulman
 
PDF
The Datacenter Network You Wish You Had
Jeremy Schulman
 
PDF
The Rules of Network Automation - Interop/NYC 2014
Jeremy Schulman
 
PPTX
A Networking View for the DevOps Crew: SDN
Jeremy Schulman
 
PPTX
About Jeremy Schulman
Jeremy Schulman
 
PPTX
A Network Engineer's Approach to Automation
Jeremy Schulman
 
Network Config Backups - Netbox, Github, Ansible
Jeremy Schulman
 
Automating "Network Ready for Use" with pytest
Jeremy Schulman
 
The Datacenter Network You Wish You Had
Jeremy Schulman
 
The Rules of Network Automation - Interop/NYC 2014
Jeremy Schulman
 
A Networking View for the DevOps Crew: SDN
Jeremy Schulman
 
About Jeremy Schulman
Jeremy Schulman
 
A Network Engineer's Approach to Automation
Jeremy Schulman
 
Ad

Recently uploaded (20)

PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Ad

Python for Network Engineers - A Practical Guide for Getting Started

  • 1. © Jeremy Schulman - 2018 - All Rights Reserved Python for Network Engineers Chapter 1 A Practical Guide for Getting Started Jeremy Schulman @nwkautomaniac
  • 2. © Jeremy Schulman - 2018 - All Rights Reserved Jeremy Schulman ● Software Engineer ● 20 Years in Industry ● Since 2012 exclusively focused on "network automation" ● Other Roles: ○ Developer Advocate ○ Systems Engineer ○ Automation Architect ○ Open source contributor @nwkautomaniac Slides: https://www.slideshare.net/ jeremyschulman Github: https://github.com/ jeremyschulman
  • 3. © Jeremy Schulman - 2018 - All Rights Reserved Obligatory Disclaimer The views and opinions expressed in this presentation are Jeremy Schulman's and do not represent any employer past or present. Reference materials provided in this presentation, such as links to external training sites, do not represent any form of recommendation.
  • 4. © Jeremy Schulman - 2018 - All Rights Reserved Network Engineers need to competently use Python so that they can make, and make use of, power-tools that will improve their jobs. These tools will not replace them.
  • 5. © Jeremy Schulman - 2018 - All Rights Reserved Agenda ● Discussion ○ Realistic expectations ○ Getting started ● Live coding ○ Jupyter Notebook - makes Python feel like a CLI ○ NetOps example exercises ● Where to go from here ...
  • 6. © Jeremy Schulman - 2018 - All Rights Reserved "Manual via CLI" "SNMP based products" "Vendor Products" "SDN" "Orchestration Systems" "DevOps" "Network Automation" "Network Engineers must become Software Engineers" Managing Networks
  • 7. © Jeremy Schulman - 2018 - All Rights Reserved "Manual via CLI" "SNMP based products" "Vendor Products" "SDN" "Orchestration Systems" "DevOps" "Network Automation" "Network Engineers must become Software Engineers" Managing Networks
  • 8. © Jeremy Schulman - 2018 - All Rights Reserved Learning any New Skill [1] Novice Expert MasterCompetent Proficient Experience over a long time ● Use everyday concrete experiences, not abstract concepts ● Attaining core competency requires instructor led training and / or directed tutorials Jeremy's key takeaways: ● Attaining proficient skill requires experience and knowledge that takes massive time investment ● Continuous mentorship, peer-review, feedback, learning, experimentation
  • 9. © Jeremy Schulman - 2018 - All Rights Reserved Systems are Risky and Complex Manage Distributed Network Services High Risk Complex Tasks Low Risk Simple Tasks Configuration Management “config” Situational Awareness “show” Host-Only (blast radius = 1) Distributed System (blast radius > 1)
  • 10. © Jeremy Schulman - 2018 - All Rights Reserved Where to start using Python High Risk Complex Tasks Low Risk Simple Tasks Configuration Management “config” Situational Awareness “show” Host-Only (blast radius = 1) Distributed System (blast radius > 1) "Your network is a crime scene, and you are the detective. You need better ways to investigate what happened, and prove guilt or innocence". -- Jeremy
  • 11. © Jeremy Schulman - 2018 - All Rights Reserved Live Coding Make Python *feel* like being on a CLI http://jupyter.org/
  • 12. © Jeremy Schulman - 2018 - All Rights Reserved Jupyter Notebook $ virtualenv playground $ source playground/bin/activate (playground)$ pip install ipython==5 jupyter Setup a Python virtual-environment (playground)$ pip install jupyter Install Jupyter notebook for Python 2.7 Install Jupyter notebook for Python 3
  • 13. © Jeremy Schulman - 2018 - All Rights Reserved Jupyter Notebook (playground)$ jupyter notebook Start Jupyter notebook system, will launch browser
  • 14. © Jeremy Schulman - 2018 - All Rights Reserved Novice Topics ● Variables, duck-typing ● help(), type(), dir() ● pretty-printing ● Importing packages ● List, Dictionary ● Tuple, Set ● Functions ● For-loops ● If / Then / Else ● Working with files ● JSON, YAML files ● List Comprehensions ● Dictionary Comprehensions ● Set Comprehensions ● Collections - Counter ● Collections - defaultdict
  • 15. © Jeremy Schulman - 2018 - All Rights Reserved Python Libraries ● ipaddress ● tabulate ● first ● tqdm ● requests ● collections ● csv ● json ● yaml ● gtextfsm ● netmiko ● napalm ● lxml ● paramiko ● bidict ● operator ● itertools ● chain
  • 16. © Jeremy Schulman - 2018 - All Rights Reserved NetOps Examples 1. Use NAPALM drivers to execute device-specific CLI commands a. Arista EOS b. Cisco NX-OS 2. Process IP routing table information 3. Process LLDP neighbor information 4. Process Interface information
  • 17. © Jeremy Schulman - 2018 - All Rights Reserved Next Steps ● Take formal Python courses ● Global Knowledge ● Subscribe to Python News ○ Dan Bader ○ https://www.pythonweekly.com/ ● https://www.python.org/ ● Try PyCharm IDE (Integrated Development Environment) ● Use Python every day ● Use Jupyter notebook ● Take industry classes ○ IpSpace ○ NetworkToCode ○ Kirk Byers ● Free Cisco DevNet Building Novice Skills Building Competency
  • 18. © Jeremy Schulman - 2018 - All Rights Reserved Closing Thoughts "A good network engineer is proficient at quickly becoming competent." -- Derick Winkworth (@cloudtoad) ● Be patient. Set realistic goals, both with yourself and your management ● Consider how long it took you to become a Senior Network Engineer
  • 19. © Jeremy Schulman - 2018 - All Rights Reserved Cheers! Jeremy Schulman @nwkautomaniac