Skip to main content

Python package for interacting with IP Fabric

Project description

IP Fabric

IPFabric is a Python module for connecting to and communicating against an IP Fabric instance.

About

Founded in 2015, IP Fabric develops network infrastructure visibility and analytics solution to help enterprise network and security teams with network assurance and automation across multi-domain heterogeneous environments. From in-depth discovery, through graph visualization, to packet walks and complete network history, IP Fabric enables to confidently replace manual tasks necessary to handle growing network complexity driven by relentless digital transformation.

v7.0.0 Deprecation Notices

In ipfabric>=v7.0.0 the following will be deprecated:

  • ipfabric_diagrams package will move to ipfabric.diagrams
  • Python 3.7 support will be removed.
  • The use of token='<TOKEN>' or username='<USER>', password='<PASS>' in IPFClient() will be removed:
    • Token: IPFClient(auth='TOKEN')
    • User/Pass: IPFClient(auth=('USER', 'PASS'))
    • .env file will only accept IPF_TOKEN or (IPF_USERNAME and IPF_PASSWORD) and not auth

Versioning

Starting with IP Fabric version 5.0.x the python-ipfabric and python-ipfabric-diagrams will need to match your IP Fabric version. The API's are changing and instead of api/v1 they will now be api/v5.0.

Version 5.1 will have backwards compatability with version 5.0 however 6.0 will not support any 5.x versions. By ensuring that your ipfabric SDK's match your IP Fabric Major Version will ensure compatibility and will continue to work.

Installation

Quick Start:

pip install ipfabric

Poetry:

IPFabric uses Poetry to make setting up a virtual environment with all dependencies installed quick and easy.

Install poetry globally:

pip install poetry

To install a virtual environment run the following command in the root of this directory.

poetry install

To run examples, install extras:

poetry install ipfabric -E examples

Introduction

Please take a look at API Programmability - Part 1: The Basics for instructions on creating an API token.

Most of the methods and features can be located in Examples to show how to use this package. Another great introduction to this package can be found at API Programmability - Part 2: Python

Diagrams

Diagramming in IP Fabric version v4.3 and above has been moved to it's own package.

pip install ipfabric-diagrams

Authentication

Username/Password

Supply in client:

from ipfabric import IPFClient
ipf = IPFClient('https://demo3.ipfabric.io/', auth=('user', 'pass'))

Token

from ipfabric import IPFClient
ipf = IPFClient('https://demo3.ipfabric.io/', auth='token')

Environment

The easiest way to use this package is with a .env file. You can copy the sample and edit it with your environment variables.

cp sample.env .env

This contains the following variables which can also be set as environment variables instead of a .env file.

IPF_URL="https://demo3.ipfabric.io"
IPF_TOKEN=TOKEN
IPF_VERIFY=true

Or if using Username/Password:

IPF_URL="https://demo3.ipfabric.io"
IPF_USERNAME=USER
IPF_PASSWORD=PASS

Development

Follow the poetry install then follow instructions below:

To test and build:

poetry run pytest
poetry build

Prior to pushing changes run:

poetry run black ipfabric
poetry update

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipfabric-6.2.0b0.tar.gz (100.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ipfabric-6.2.0b0-py3-none-any.whl (122.6 kB view details)

Uploaded Python 3

File details

Details for the file ipfabric-6.2.0b0.tar.gz.

File metadata

  • Download URL: ipfabric-6.2.0b0.tar.gz
  • Upload date:
  • Size: 100.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.9.9 Windows/10

File hashes

Hashes for ipfabric-6.2.0b0.tar.gz
Algorithm Hash digest
SHA256 0fc26483a4189ba0b56b5684bc80e91cece17cd3c8a7b8f769d9e04bcf7991a0
MD5 5d33d8b18c31cbfaf0ceae4ab51d8fbb
BLAKE2b-256 35de8ae43c83936c350b19c7217968f068f022ec9bdfa7404f7ff0116605cd3e

See more details on using hashes here.

File details

Details for the file ipfabric-6.2.0b0-py3-none-any.whl.

File metadata

  • Download URL: ipfabric-6.2.0b0-py3-none-any.whl
  • Upload date:
  • Size: 122.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.9.9 Windows/10

File hashes

Hashes for ipfabric-6.2.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c957dd400743f1490dc1214fb211294b3f51a1553649d1037f50a28cdfbeaba
MD5 e1a6f19d31e779bba244613c74d3ad18
BLAKE2b-256 79ea4cd261dd9cca33ac0018e56aac1899bf0c0331df7809a2f16ebed26ffc17

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page