Skip to main content

Configuration management with scrapli

Project description

Supported Versions PyPI version Weekly Build Coverage Code Style License: MIT

scrapli_cfg


Documentation: https://scrapli.github.io/scrapli_cfg

Source Code: https://github.com/scrapli/scrapli_cfg

Examples: https://github.com/scrapli/scrapli_cfg/tree/master/examples


scrapli_cfg makes merging or replacing device configurations over Telnet or SSH easy, all while giving you the scrapli behaviour you know and love.

NOTE this is still a work in progress, there is a lot of work to be done on the testing front in particular!

Key Features:

  • Easy: It's easy to get going with scrapli and scrapli-cfg -- check out the documentation and example links above, and you'll be managing device configurations in no time.
  • Fast: Do you like to go fast? Of course you do! All of scrapli is built with speed in mind, but if you really feel the need for speed, check out the ssh2 transport plugin to take it to the next level! All the "normal" scrapli transport plugin goodness exists here in scrapli-cfg too!
  • Great Developer Experience: scrapli_cfg has great editor support thanks to being fully typed; that plus thorough docs make developing with scrapli a breeze.

Requirements

MacOS or *nix1, Python 3.6+

scrapli_cfg's only requirements is scrapli.

1 Although many parts of scrapli do run on Windows, Windows is not officially supported

Installation

pip install scrapli-cfg

See the docs for other installation methods/details.

A simple Example

from scrapli import Scrapli
from scrapli_cfg import ScrapliCfg

device = {
   "host": "172.18.0.11",
   "auth_username": "vrnetlab",
   "auth_password": "VR-netlab9",
   "auth_strict_key": False,
   "platform": "cisco_iosxe"
}

with open("myconfig", "r") as f:
    my_config = f.read()

conn = Scrapli(**device)
cfg_conn = ScrapliCfg(platform=device["platform"], conn=conn)
cfg_conn.open()
cfg_conn.load_config(config=my_config, replace=True)
diff = cfg_conn.diff_config()
print(diff.side_by_side_diff)
cfg_conn.commit_config()
cfg_conn.close()

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

scrapli_cfg-2021.7.30a2.tar.gz (29.0 kB view hashes)

Uploaded Source

Built Distribution

scrapli_cfg-2021.7.30a2-py3-none-any.whl (54.6 kB view hashes)

Uploaded Python 3

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