Configuration management with scrapli
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for scrapli_cfg-2021.7.30a2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5ed99ff9de39edf46aec598667c2932dc0fe7f17f80531304d76f0d2637ee26 |
|
MD5 | ea8ccc15b2e140884297eaa751f2605c |
|
BLAKE2b-256 | 933635c12d23dc992adc89589c14f283943c186fe48abf477adc83321ab2a6e5 |