A journey from writing a script to publishing my first Python module.

Network automation has been one of my favorite topics for a long time.

I’ve attended seminars , trainings and wrote low-quality code some of which got me an awesome t-shirt 😁

Last year I started using IP Fabric and joined the Ambassador program.

I immediately noticed the value of combining the discovery process and API-accessible inventory of IP Fabric with my favorite network automation tool Nornir .

The main reason is to save time, delegating to IP Fabric the creation of the inventory and collecting information from the network devices.

For a small team this means having more time to focus on the automation scripts instead of scraping CLI output and maintaining RegExp in discovery scripts. Note that this is just a small part of the product features.

After some tests I published a MVP script to import the IP Fabric inventory into Nornir (available here ). This was the easy win, but far from a final product.

Being a n00b coder with my Dunning-Kruger factor set to 11 I felt immediately ready to send a PR to merge the plugin into Nornir .

But no plan survives contact with the enemy and #486 happened:

RFC separating plugins from nornir core. Plugins will live in their own repo.

With this new unplanned obstacle on the path I had two options:

  1. give up
  2. learn how to write and publish a Python module

That’s the story about how I started a new challenge and spent nights and weekends having no idea of what I was doing reading documentation and learning from other people's code how to create a proper Python module starting from a script.

So now I’m happy to announce I’ve released my first Python module nornir_ipfabric.

nornir-ipfabric on PyPI nornir-ipfabric on PyPI

The use of the module is described in the README with some examples.

The journey

Photo by Matt Duncan on Unsplash Photo by Matt Duncan on Unsplash

Some people say

The journey is more important than the destination.

That’s true in most cases but at the same time the destination is the reason we take the first step and hit the road, a journey without a destination is wandering.

I really enjoyed the journey, it forced me out of my comfort zone, I had to learn new tools and to read a lot of source code. The former is a very effective way to learn but beware of the dark side of copy-paste programming.

The Destination

Every destination is just another dot on a bigger diagram.

Creating nornir_ipfabric I’ve slightly experienced the daily work of coders and I must admit I really enjoyed it.

I have no plans to give up my career as Network Engineer to work as a full-time dev, but now the two worlds are colliding so a mix of the two roles is very likely to happen.

Wrap up

If you like to test the nornir-ipfabric module start with an IP Fabric trial license and then pip install nornir-ipfabric.

Feel free to open an issue if you find any bugs.

nornir-ipfabric on Pypi

nornir-ipfabric source code on GitHub

Nornir Plugins page .

Using IP Fabric with Nornir on IP Fabric blog