Skip to main content

Compare configuration files using contextual structures

Project description


This package contains two main elements used to compare text-based configuration files (or other files in simple text in a similar format) where they are structured using indented blocks of directives/commands:

  • a parser to read in configuration files and stored them in a dictionary -- the parser utilises the hierarchical nature of the configuration to understand that the same command name might mean different things in different contexts

  • a comparator that takes two configuration dictionaries (typically produced by the parser, above) - a source and a target configuration - and writes out a configuration file (or update command set) to transform the source configuration into the destination

Currently, only Cisco IOS configuration files can be parsed and compared, but the parser and comparators (and the wrapper command line tool) are written such that they should be extensible to new platforms (by creating new concrete classes from the abstract toplevel classes).

At the present time, only a subset of configuration directives for Cisco IOS are supported but more can be added, as required.

The scripts also support a system whereby rules can be included (rather like an access control list) to specify which elements of the configuration are included in the output. This allows known differences to be ignored.

Project details

Download files

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

Files for cfg-contextdiff, version 0.6.4
Filename, size File type Python version Upload date Hashes
Filename, size cfg_contextdiff-0.6.4-py3-none-any.whl (35.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size cfg-contextdiff-0.6.4.tar.gz (31.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page