Metadata-Version: 2.5
Name: nac-analytics
Version: 0.1.0
Summary: Change analysis for Cisco Nexus Dashboard 4.2.1+.
Project-URL: homepage, https://github.com/netascode/nac-analytics
Project-URL: repository, https://github.com/netascode/nac-analytics
Project-URL: documentation, https://github.com/netascode/nac-analytics#readme
Project-URL: issues, https://github.com/netascode/nac-analytics/issues
Author: Ed Moore
Maintainer: Ed Moore
Maintainer-email: Daniel Schmidt <danischm@cisco.com>
License: MPL-2.0
License-File: LICENSE
Keywords: aci,cisco,cli,nexus-dashboard,pre-change,validation
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: System :: Networking
Requires-Python: >=3.10
Requires-Dist: httpx>=0.28.1
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: pyyaml>=6.0.2
Requires-Dist: typer>=0.15.0
Provides-Extra: dev
Requires-Dist: mypy>=1.13.0; extra == 'dev'
Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
Requires-Dist: pytest>=8.3.0; extra == 'dev'
Requires-Dist: ruff>=0.8.0; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0.12; extra == 'dev'
Description-Content-Type: text/markdown

# nac-analytics

> **In development** — install from source today; PyPI release planned.
> Formerly **nac-nd**. Today it covers Cisco ACI via Nexus Dashboard 4.2.1+; the intent is to grow beyond Nexus Dashboard and add support for additional Cisco products, so one tool can drive change analytics across platforms.

CLI for change analysis on Cisco ACI fabrics via Nexus Dashboard 4.2.1+.

Commands are grouped per Cisco product: `nac-analytics <product> <command>`.
Today the product is `nexus-dashboard` (alias `nd`); more products are planned.

## Documentation

| Topic | Link |
| --- | --- |
| Documentation hub | [docs/README.md](docs/README.md) |
| Nexus Dashboard | [docs/nexus-dashboard.md](docs/nexus-dashboard.md) |
| Command reference | [docs/commands/README.md](docs/commands/README.md) |
| Exit codes | [docs/exit-codes.md](docs/exit-codes.md) |
| Configuration | [docs/configuration.md](docs/configuration.md) |
| Examples & CI | [examples/README.md](examples/README.md) |
| Development | [docs/development.md](docs/development.md) |

## Nexus Dashboard Examples - delta & compliance

**delta** — compare snapshots after a change:

```bash
$ nac-analytics nd delta -output text

command: delta
fabric: FABRIC-A
pre_snapshot: snap-pre
post_snapshot: snap-post

=== Summary (/deltaAnalysis/summary) ===

New anomalies by severity:
  major     2

FAIL: New anomalies at or above the failure threshold: 2 major.

=== Resources (/deltaAnalysis/resources) ===
resourceType           new       removed       earlier         later
      tenant             1             0            12            13

=== Anomalies (/anomalies/details) ===
  severity     mnemonic                         resource              reason
  major        ENDPOINT_DUPLICATE_IP            web-epg              duplicate ip detected
```

**compliance** — rule status for the latest snapshot (by default, latest snapshot is used):

```bash
$ nac-analytics nd compliance -output text

command: compliance
fabric: FABRIC-A
snapshot: latest

Compliance:
  scope: latest snapshot
  enforced_rules: 42
  violated_rules: 1
  violating_rules:
    ruleName=no-open-tenant  ruleType=configuration  violationsCount=1
```

See [prechange](docs/commands/nexus-dashboard/prechange.md), [delta](docs/commands/nexus-dashboard/delta.md), and [compliance](docs/commands/nexus-dashboard/compliance.md) for usage.

## Installation

**Requirements:** Nexus Dashboard 4.2.1+, Python 3.10+, an ACI fabric registered in Nexus Dashboard.

Install from PyPI:

```bash
pip install nac-analytics
nac-analytics --help
```

Or with [uv](https://docs.astral.sh/uv/):

```bash
uv tool install nac-analytics
nac-analytics --help
```

For development from source:

```bash
git clone https://github.com/netascode/nac-analytics.git
cd nac-analytics
uv sync --extra dev
uv run nac-analytics --help
```

## Quick start

```bash
cp config.example.yaml nac-analytics.yaml   # edit host, fabric, domain
cp .env.example .env                 # set ND_USER and ND_PASSWORD
nac-analytics nd doctor
```

When working from a source checkout, prefix commands with `uv run` (for example `uv run nac-analytics nd doctor`).

## Configuration

Precedence: CLI flags → environment variables → YAML → `.env` in cwd.

Settings are scoped per product. See [config.example.yaml](config.example.yaml) and [Configuration](docs/configuration.md).

## Development

Contributors: see [Development](docs/development.md).
