Metadata-Version: 2.1
Name: vetr-summarizer
Version: 0.2.0
Summary: A Python package for visualizing ACI vetR JSON data
Author-email: Osama Abbas <oabbas2512@gmail.com>
Maintainer-email: Osama Abbas <oabbas2512@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Osama Abbas
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project-URL: Homepage, https://github.com/Tes3awy/vetr-summarizer
Project-URL: Repository, https://github.com/Tes3awy/vetr-summarizer
Project-URL: Issues, https://github.com/Tes3awy/vetr-summarizer/issues
Project-URL: Say Thanks!, https://saythanks.io/to/Tes3awy
Project-URL: Changelog, https://github.com/Tes3awy/vetr-summarizer/main/CHANGELOG.md
Keywords: Cisco,ACI,automation,vetr-collector,devnet,datacenter,summarizer,JSON
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: System :: Networking :: Monitoring
Classifier: Topic :: System :: Systems Administration
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: <4,>=3.9.0
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: jinja2>=3.0.0
Provides-Extra: dev
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: bumpver; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"

[![published](https://static.production.devnetcloud.com/codeexchange/assets/images/devnet-published.svg)](https://developer.cisco.com/codeexchange/github/repo/Tes3awy/vetr-summarizer)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/vetr-summarizer)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat-square&labelColor=ef8336)](https://pycqa.github.io/isort/)
![PyPI - License](https://img.shields.io/pypi/l/vetr-summarizer)
![PyPI - Version](https://img.shields.io/pypi/v/vetr-summarizer)
![PyPI - Status](https://img.shields.io/pypi/status/vetr-summarizer)
![Pepy Total Downlods](https://img.shields.io/pepy/dt/vetr-summarizer)
![Commit Activity](https://img.shields.io/github/commit-activity/m/Tes3awy/vetr-summarizer/main?logo=github)
[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/Tes3awy)

## Table of Contents

1. [vetR Summarizer](#vetr-summarizer)
2. [Objective](#objective)
3. [How it Works](#how-it-works)
4. [Installation](#installation)
5. [Usage](#usage)
6. [Use Case](#use-case)

![ACI](./assets/aci.jpg)

## vetR Summarizer

This tool summarizes data from any APIC collected by [vetr-collector](https://github.com/brightpuddle/vetr-collector).

## Objective

This tool processes data collected by [vetr-collector](https://github.com/brightpuddle/vetr-collector) for the ACI health check and displays it in a pretty HTML tabluar format. This tool can also be run from any computer having `aci-vetr-data` collected from any APIC.

The `aci-vetr-data` directory you get from `vetr-collector v3.3.0` includes **91** raw JSON files.

```bash
$ ls aci-vetr-data
apPlugin.json
bgpRRNodePEp.json
configRsRemotePath.json
coopPol.json
ctxClassCnt.json
datetimeNtpProv.json
datetimePol.json
epControlP.json
epIpAgingP.json
epLoopProtectP.json
...
<output_truncated>
```

_A sample preview of the output HTML_

![Preview](./assets/preview.jpg)

## How it works

This tool visualizes data collection for the ACI health check from [vetr-collector](https://github.com/brightpuddle/vetr-collector).

Once the analysis is complete, the tool creates a `vetr-summary.html` file. This file displays the raw JSON data in a [DataTable](https://datatables.net/) tabular format. DataTable adds the ability to easily search for properties in concern.

Almost all [MOs](https://www.cisco.com/c/en/us/td/docs/switches/datacenter/aci/apic/sw/policy-model-guide/b-Cisco-ACI-Policy-Model-Guide.html#id_107445__d54e1142) include unnecessary configuration properties. Some of these  properties: `extMngdBy`, `childAction`, `userdom`, etc. These unnecessary properties (key-value pairs) are excluded from the report for a neater representation of the output in the HTML file. 

> _All excluded keys can be found in [`config/excluded_keys`](https://github.com/Tes3awy/vetr-summarizer/tree/main/src/vetr_summarizer/config) file._ You can also customize these keys-to-exclude according to your own case. _An empty excluded\_keys file will not exclude any keys_.

> Raw JSON files with empty `imdata` and `totalCount` equal to `0` are not presented in the HTML `vetr-summary.html` summary report.

## Installation

> Install from PyPi

```bash
$ pip install --user vetr-summarizer
```

## Usage

> Both keyword arguments are optional. _Currently `html` is the only supported output format_.

```bash
$ vetr-summarizer --help
usage: vetr-summarizer [-h] [-f {html}] [-x EXCLUDE_FILE] [-v] directory  

Process and summarize aci-vetr-data JSON files into HTML reports.

positional arguments:
  directory             A path to the directory containing the JSON files.

options:
  -h, --help            show this help message and exit
  -f {html}, --format {html}
                        Output format (html).
  -x EXCLUDE_FILE, --exclude-file EXCLUDE_FILE
                        File containing keys to exclude from the summary HTML report.
  -v, --version         show program's version number and exit

Thanks for using vetr-summarizer! :)
```

```bash
$ vetr-summarizer "/path/to/aci-vetr-data"

HTML output is written to /path/to/vetr-summary.html
```

> With custom excluded keys

```bash
$ vetr-summarizer -x custom_excluded_keys "/path/to/aci-vetr-data"

HTML output is written to /path/to/vetr-summary.html
```

## Use Case

I was once going through the Cisco Community and found a [question](https://community.cisco.com/t5/application-centric-infrastructure/vetr-zip-logs/td-p/4804529), what is actually vetr zip logs? 

![Question](./assets/q.jpg)

So, I decided to try `vetr-collector` on an environment. But, I got to open each raw JSON file to check whether it has objects and was time-consuming going through all the files. So, I made this package to summarize the output from `vetr-collector` in a pretty HTML tabular format.

## Author

[Osama Abbas](https://www.linkedin.com/in/oabbas/)

## Contributions

As there is always a room for imporovment, you are welcome to contribute to `vetr-summarizer`.
