- Podcasts
- CyberSecurity Summary
- Mastering Python Networking: Utilize Python packages and frameworks for network automation, monitoring, cloud, and management
Mastering Python Networking: Utilize Python packages and frameworks for network automation, monitoring, cloud, and management
CyberSecurity Summary
- May 10, 2025
- 31 min
About this episodeIntroduce Python as a powerful and versatile tool for modern network engineering tasks. They discuss fundamental networking concepts like…
You can listen and download our episodes for free on more than 10 different platforms:
https://linktr.ee/cyber_security_summary
Get the Book now from Amazon:
https://www.amazon.com/Mastering-Python-Networking-frameworks-automation/dp/180323461X?&linkCode=ll1&tag=cvthunderx-20&linkId=c83e785bf061dc5b4588be3a7989c04a&language=en_US&ref_=as_li_ss_tl
Discover our free courses in tech and cybersecurity, Start learning today:
https://linktr.ee/cybercode_academy
Transcript
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
Mastering Python Networking: Utilize Python packages and frameworks for network automation, monitoring, cloud, and management
It really shows how central Python has become. It's everywhere in networking, right across the board, and that's why we're here for you, the learner. Our goal today is to boil down those core concepts, show you the practical waves Python is actually being used right now. We want to give you those you know, aha.
Absolutely not. And the book points out that those older methods, the ones relying on screen scraping just reading text output from the CLI, yeah, they were particularly bad for this, not idempatent at all, usually because if the format of the CLA output changed just slightly, maybe after a software upgrade.
Right, So instead of your Python script trying to guess where the important info is in a block of CLI text, which can change, it gets a neat, predictable data structure. It knows exactly where to find the interface status or the routing table entries. It's like getting data from a well organized spreadsheet versus trying to read handwritten notes. Much more reliable.
Arista's EAPI also relies on web protocols, typically Jason RPC over HTDPS. The book mentions configuring connection details in a file dot epi dot com. You can pick file and then using the piple Python library to send commands and get structured data back. It even shows an example of creating vlands using pioppy.
So the key thing here for you, the learner, is seeing this pattern right. Vendors provide APIs, maybe net conframe, maybe rest, maybe something pustom like NXAPI or eapi, and then there are often Python libraries, either from the vendor or the community, to make using those APIs easier exactly.
All that stuff, loads of them for network devices, servers, cloud platforms, and playbooks organize these modules into tasks. You can also have handlers, which are tasks triggered by changes variables to customize things may be stored in hostars per device, and loops to apply tasks to multiple devices easily.
SNMP starts with the classic SNMP, the Simple Network Management Protocol been around forever, still widely used the work, but as the book notes, it has limitations. It can put a load on the device CPU, the agent running there, and you need to know the specific OIDs, those numeric addresses for pieces of data.
Exactly, understanding who's talking to whom, what applications are using bandwidth. The book mentions using pythons built in socket instruct modules for parsing raw NetFlow packets low level stuff yeah, and for s flow. It mentions external tools like slow tool and the slow RT collector that you might integrate with.
The book even touches on defining data models for your network resources using an extension called Flask school Alchemy. If you need a database, and importantly, how to secure these APIs you build using Flask httb out for authentication and authorization. You don't want just anyone triggering network changes via your API.
Log Stash and related tools called Beats is used for collecting and processing data from various sources cyslogs, from routers, application logs, et cetera. Elastic Search is the distributed search and analytics engine where the data gets stored and indexed, and Kubana is the visualization layer dashboards charts exploring the data.
Yeah, the fundamentals dock commit to save changes, push to send changes to a remote repository like GitHub, pull to get changes from others, and also mentions dot get ignored files for telling Get which files not to track, like passwords or temporary files. Right, don't want secrets in your Git repo? Definitely not. And for deeper Python integration, the book introduces libraries like get python for interacting with local Git repos and pi GitHub for interacting with the GitHub api, so.
The book introduces the principles of CI automatically building, testing, and validating changes every time someone commits new code. For networks. This could mean automatically linting your Python scripts, checking playbook syntax, maybe even spinning up a lab environment like with container lab and running tests against virtual devices.
It's the glue. Like the book said earlier. Okay, so here's something to chew on. Looking forward, how do you think the continued evolution of device APIs maybe more standardization like with YANG and the ongoing development of Python libraries. How is that going to further reshape network engineering?
