Skip to content

Python SDK Overview

IP Fabric is a Python API for connecting to and communicating against an IP Fabric instance using IP Fabric’s Rest API.

The IP Fabric Python SDK allows you to quickly gather data from your network in as little as 3 lines of code.

Installing Python IP Fabric

Minimum Requirements

  • Python 3.8.1+
  • Access to an instance of IP Fabric
  • API Token or Username/Password to IP Fabric

Getting Started

Ensure git is installed and configured

Follow git-downloads for your deployment, and git clone this repo.

git clone
git clone

Cloning into 'python-ipfabric'...
remote: Enumerating objects: 5805, done.
remote: Counting objects: 100% (168/168), done.
remote: Compressing objects: 100% (144/144), done.
remote: Total 5805 (delta 85), reused 24 (delta 24), pack-reused 5637 (from 1)
Receiving objects: 100% (5805/5805), 2.88 MiB | 7.24 MiB/s, done.
Resolving deltas: 100% (3824/3824), done.
Change directory into the cloned project
cd python-ipfabric
Follow either Poetry or pip to continue the getting started guide.

Poetry is a Python package manager that makes spinning up a virtual environment ready to run your code quick and easy.

Make sure you have Poetry installed in your Python environment:

pip install poetry 

Since Poetry manages all the required packages, you only have to run one command to install all the dependencies required for Python IP Fabric:

poetry install  

Want to install all the dependencies required to run our example scripts?

poetry install -E examples


pip install ipfabric

To run scripts in the example directory:

pip install ipfabric[examples]

Using the SDK

Setting Up an API Token

Please follow the instruction on the API Tokens documentation page.

Environment Variables

Please add the following environment variables to your .env file:

Variable Name Python Parameter Default Description
IPF_URL base_url None IP Fabric URL
IPF_TOKEN auth None API Token
IPF_VERIFY verify True Enforce SSL


Once you set up your environment variables:


To quickly get an inventory of devices or interfaces:

from ipfabric import IPFClient

ipf = IPFClient()


For each Technology table in IP Fabric, you have a way to quickly gather the data:


Each one of these technologies relates to data IP Fabric has gathered about your network devices.

For example, to view NTP configurations: