You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

scrapli-cfg

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scrapli-cfg

Network device configuration management with scrapli

2025.1.30
PyPI
Maintainers
1

Supported Versions PyPI version Weekly Build 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.

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()

Keywords

arista

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts