Skip to main content

Network asyncio command runner using Scrapli

Project description

Supported Versions Code Style


An async network command runner built using Scrapli. You provide and inventory and tasks (functions), and the runner does the rest.

Currently only working with Cisco IOS and NXOS devices, but I will be adding others.


pip install netrunner

Basic Usage

Here is a basic example. More examples can be found in the examples folder.

import asyncio

from netrunner import Runner

hosts = [
    {"hostname": "SW1021", "ip": "", "platform": "ios"},
    {"hostname": "SW1031", "ip": "", "platform": "ios"},
    {"hostname": "NX1001", "ip": "", "platform": "nxos"},
    {"hostname": "NX2001", "ip": "", "platform": "nxos"},

# Here is a task. The first parameter is the host and must be provided.
# Other parameters can also be passed into the tasks/functions.
# Please see the examples in the example folder.
async def first_task(host):
    # Commands must be passed in via a list. By default the output is parsed using
    # Genie, but parse can be set to False if raw output is required
    result = await host.send_command(["show version", "show vlan"])
    return result

async def main():
    # Hosts can either be passed here to be used globally, or can be passed per task
    runner = Runner(username="test_user", password="T3stpass", hosts=hosts)
    result = await"Check Version and Vlan", task=first_task)
    print(result.result["show version"])
    print(result.result["show vlan"])

if __name__ == "__main__":

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netrunner-0.1.6.tar.gz (6.8 kB view hashes)

Uploaded source

Built Distribution

netrunner-0.1.6-py3-none-any.whl (8.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page