Skip to main content

Nornir Inspect

Nornir Inspect is a lightweight Python library for visually inspecting the structure of Nornir task results.
It formats nested AggregatedResult, MultiResult, and Result objects into a readable tree layout.

Install

pip install nornir-inspect

or

uv add nornir-inspect

Usage

Nornir setup steps
from nornir import InitNornir
from nornir.core.task import Result, Task

nr = InitNornir(
     runner={
         "plugin": "threaded",
         "options": {
             "num_workers": 10,
         },
     },
     inventory={
         "plugin": "SimpleInventory",
         "options": {"host_file": "tests/hosts.yaml"},
     },
     logging={"enabled": False},
 )


def task_1(task: Task, number: int) -> Result:
     n = number + 1
     return Result(host=task.host, result=f"{n}")


result = nr.run(task=task_1, number=1)
from nornir_inspect import nornir_inspect

nornir_inspect(result)

<class 'nornir.core.task.AggregatedResult'>
├── failed = False
├── failed_hosts = {}
├── name = task_1
├── <class 'nornir.core.task.MultiResult'> ['node1']
│   ├── failed = False
│   ├── failed_hosts = {}
│   ├── name = task_1
│   └── <class 'nornir.core.task.Result'> [0]
│       ├── changed = False
│       ├── diff =
│       ├── exception = None
│       ├── failed = False
│       ├── host = node1
│       ├── name = task_1
│       ├── result = 2
│       ├── severity_level = 20
│       ├── stderr = None
│       └── stdout = None
├── <class 'nornir.core.task.MultiResult'> ['node2']
│   ├── failed = False
│   ├── failed_hosts = {}
│   ├── name = task_1
│   └── <class 'nornir.core.task.Result'> [0]
│       ├── changed = False
│       ├── diff =
│       ├── exception = None
│       ├── failed = False
│       ├── host = node2
│       ├── name = task_1
│       ├── result = 2
│       ├── severity_level = 20
│       ├── stderr = None
│       └── stdout = None
└── <class 'nornir.core.task.MultiResult'> ['node3']
    ├── failed = False
    ├── failed_hosts = {}
    ├── name = task_1
    └── <class 'nornir.core.task.Result'> [0]
        ├── changed = False
        ├── diff =
        ├── exception = None
        ├── failed = False
        ├── host = node3
        ├── name = task_1
        ├── result = 2
        ├── severity_level = 20
        ├── stderr = None
        └── stdout = None

Additional Options

  • vals: bool – If True, the values of the object's attributes will be printed.
    Default: True

  • headings: bool – If True, the first line of the output will include the object's key name or list position.
    Default: True

Metadata

Release files for nornir-inspect 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nornir-inspect 1.1.1
File Size Uploaded Provenance Actions
nornir_inspect-1.1.1.tar.gz 63.5 kB Without provenance Details for nornir_inspect-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nornir-inspect 1.1.1
File Interpreter ABI Platform Actions
nornir_inspect-1.1.1-py3-none-any.whl Python 3 none any Details for nornir_inspect-1.1.1-py3-none-any.whl

Total release size: 70.6 kB

Release files / nornir_inspect-1.1.1.tar.gz

Download URL nornir_inspect-1.1.1.tar.gz
Size 63.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f6180d6bb01286cacecbf75af3aa254b7be26be42e0883ebb7cd43f3650b0107
BLAKE2b-256 checksum
How to use checksums
f653576f490bb920f2ac8106686f7b769aced1fb8213c547bf2cd1420e80be2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.6

Release files / nornir_inspect-1.1.1-py3-none-any.whl

Download URL nornir_inspect-1.1.1-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
809beaccda25d56ac3f6005147d10da94a0b7e5bfccd6e81ea76c6616d77ea0d
BLAKE2b-256 checksum
How to use checksums
845598e1d4e3300da3235431a54defde1bdae33a5341cd241571feb47d6068ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.6

Security for nornir-inspect 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page