Skip to main content

A light-weight library to compare structured output from network devices show commands.

Project description

jdiff

jdiff is a lightweight Python library allowing you to examine structured data. jdiff provides an interface to intelligently compare--via key presense/absense and value comparison--JSON data objects

Our primary use case is the examination of structured data returned from networking devices, such as:

  • Compare the operational state of network devices pre and post change
  • Compare operational state of a device vs a "known healthy" state
  • Compare state of similar devices, such as a pair of leafs or a pair of backbone routers
  • Compare operational state of a component (interface, vrf, bgp peering, etc.) migrated from one device to another

However, the library fits other use cases where structured data needs to be operated on.

Installation

Install from PyPI:

pip install jdiff

Intelligent Comparison

The library provides the ability to ask more intelligent questions of a given data structure. Comparisons of data such as "Is my pre change state the same as my post change state", is not that interesting of a comparison. The library intends to ask intelligent questions like:

  • Is the route table within 10% of routes before and after a change?
  • Is all of the interfaces that were up before the change, still up?
  • Are there at least 10k sessions of traffic on my firewall?
  • Is there there at least 2 interfaces up within lldp neighbors?

Technical Overview

The library heavily relies on JMESPath for traversing the JSON object and finding the values to be evaluated. More on that here.

jdiff has been developed around diffing and testing structured data returned from Network APIs and libraries (such as TextFSM) but is equally useful when working or dealing with data returned from APIs.

Documentation

Documentation is hosted on Read the Docs at jdiff Documentation.

Project details


Download files

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

Source Distribution

jdiff-0.0.5.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

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

jdiff-0.0.5-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file jdiff-0.0.5.tar.gz.

File metadata

  • Download URL: jdiff-0.0.5.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for jdiff-0.0.5.tar.gz
Algorithm Hash digest
SHA256 70fba4f4e4be3f53a5d511104991ca58452414c725f539834f0632c731423d2a
MD5 d22dadf7a932bcca36108de03f6cde55
BLAKE2b-256 52d8676ccd00466d7f72620ebad8dc4da1bd4d732929e49d77b1bbb803867025

See more details on using hashes here.

File details

Details for the file jdiff-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: jdiff-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 23.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for jdiff-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 04ca538d24ee86fbb3952046e4a1c3d030a81fef6bb60f3ea540c4fa6b320699
MD5 0332c9a3ebd0494599e00c5aa71f4565
BLAKE2b-256 ccb12ccd10c3cf73d73dfac5a850b3a5d1aca90fd0199bcc9275b1dcc8802a82

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