Network device 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.
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.7+
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": "scrapli",
"auth_password": "scrapli",
"auth_strict_key": False,
"platform": "cisco_iosxe"
}
with open("myconfig", "r") as f:
my_config = f.read()
with Scrapli(**device) as conn:
cfg_conn = ScrapliCfg(conn=conn)
cfg_conn.prepare()
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.cleanup()
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
File details
Details for the file scrapli_cfg-2024.7.30.tar.gz
.
File metadata
- Download URL: scrapli_cfg-2024.7.30.tar.gz
- Upload date:
- Size: 37.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b36e4d1394161cb7e3ee1dbb43f7e460a9fadeb0fd2c31d07473bbb1073e7884 |
|
MD5 | 7395e33b9791222fc90a46724a2c4f60 |
|
BLAKE2b-256 | e4cdfcd8b3ce3826cef84c74025523c4241cbb4b710b6ee7a771bd05b45d0176 |
File details
Details for the file scrapli_cfg-2024.7.30-py3-none-any.whl
.
File metadata
- Download URL: scrapli_cfg-2024.7.30-py3-none-any.whl
- Upload date:
- Size: 61.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 534cd0d42cb37d4d8cbcc970ef92e5cf0307861632a5185ef873d944f1db268f |
|
MD5 | 296447df1b74d6faca671ec9ff4de2cb |
|
BLAKE2b-256 | 08bd37f83c327df710055155fd34175d1ee5d9cb0c805f1c3cfb1266a0d712b1 |