Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme to start with use cases #84

Merged
merged 3 commits into from
Sep 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# jdiff

`jdiff` is a lightweight Python library allowing you to examine structured data. `jdiff` provides an interface to intelligently compare JSON data objects and test for the presence (or absence) of keys. You can also examine and compare corresponding key-values.
`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

The library heavily relies on [JMESPath](https://jmespath.org/) for traversing the JSON object and finding the values to be evaluated. More on that [here](#customized-jmespath).
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

Expand All @@ -12,9 +19,20 @@ Install from PyPI:
pip install jdiff
```

## Use cases
## 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](https://jmespath.org/) for traversing the JSON object and finding the values to be evaluated. More on that [here](#customized-jmespath).

`jdiff` has been developed around diffing and testing structured data returned from APIs and other Python modules and libraries (such as TextFSM). Our primary use case is the examination of structured data returned from networking devices. However, we found the library fits other use cases where structured data needs to be operated on, and is especially useful when working or dealing with data returned from APIs.
`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

Expand Down