Skip to main content

PyPI version Python 3.6 Python 3.7 Python 3.8 Code Style

nornir_scrapli

nornir_scrapli -- scrapli's plugin for nornir.

Table of Contents

Quick Start Guide

Installation

In most cases installation via pip is the simplest and best way to install nornir_scrapli.

pip install nornir-scrapli

A Simple Example

Example inventory file (host/group/default, see "real" Nornir docs for lots more info!):

---
iosxe-1:
  hostname: 172.18.0.11
  connection_options:
    scrapli:
      platform: cisco_iosxe
      port: 22
      extras:
        ssh_config_file: True
        auth_strict_key: False
from nornir import InitNornir
from nornir_scrapli.tasks import (
    get_prompt,
    send_command,
    send_configs
)

nr = InitNornir(config_file="nornir_data/config.yaml")

prompt_results = nr.run(task=get_prompt)
command_results = nr.run(task=send_command, command="show version")
config_results = nr.run(
    task=send_configs,
    configs=["interface loopback123", "description nornir_scrapli was here"],
)

print("get_prompt result:")
print(prompt_results["iosxe-1"].result)
print("send_command result:")
print(prompt_results["iosxe-1"].result)
print("send_configs result:")
print(config_results["iosxe-1"].result)
$ python my_scrapli_script.py
get_prompt result:
3560CX#
send_command result:
Cisco IOS Software, C3560CX Software (C3560CX-UNIVERSALK9-M), Version 15.2(4)E7, RELEASE SOFTWARE (fc2)
<SNIP>
send_configs result:


Supported Platforms

nornir_scrapli supports the "core" scrapli drivers. See scrapli docs for more info.

General Information

Nornir has historically contained it's plugins within the actual Nornir codebase itself, this however is changing. At time of writing (27 March 2020) the end state of how plugins will work is not 100% solidified, but this should get fairly close, and it works with current and hopefully future Nornir!

If you have used Nornir before, this package should be very similar, but not exactly the same. Since the plugins currently/used to live in Nornir you could simply import them from the appropriate package as such:

from nornir.plugins.tasks.networking import netconf_get_config

With nornir_scrapli you simply install this package along side "regular" Nornir, and import the tasks from nornir_scrapli directly:

from nornir_scrapli.tasks import send_command

As soon as a nornir_scrapli task is imported, it (nornir_scrapli) will register as a connection, and things should work as normal from there!

This is obviously all in a "beta" state until Nornir 3.0 is officially released and the template for what plugins should look like is solidified, so use with care!

Metadata

Release files for nornir_scrapli 2020.3.27

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_scrapli 2020.3.27
File Size Uploaded
nornir_scrapli-2020.3.27.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nornir_scrapli 2020.3.27
File Interpreter ABI Platform
nornir_scrapli-2020.3.27-py3-none-any.whl Python 3 none any Details

Total release size: 16.4 kB

Release files / nornir_scrapli-2020.3.27.tar.gz

Download URL nornir_scrapli-2020.3.27.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b154a7e148bef64db236d20921f2239272df54e1b5102cd5209e1901311a2e44
BLAKE2b-256 checksum
How to use checksums
0046b15f2c75ef21827e0fb1d2a7e7b4cb6d6c41b9eb12bdb19e2a09cdeed0e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / nornir_scrapli-2020.3.27-py3-none-any.whl

Download URL nornir_scrapli-2020.3.27-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c18566e52ffaaac3ea8d6feaf34676164dcbdeee024479128c7d8f62f01a5241
BLAKE2b-256 checksum
How to use checksums
3a61bf134bdebeee79ec8b2a2aff1428b7c57beb7f21e74674f6cfaa55bd612f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
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