How klevernet/cisco_config_parser works
This is a Cisco running-configuration parsing library, not a device-management service. A caller supplies configuration text to ConfigParser; platform detection and specialized parsers produce structured objects or the whole-device dictionary/JSON-able model. Distinct branches cover interfaces, routing, policy/configuration sections, generic hierarchy and custom searches, plus cross-reference validation. The README documents broader section support than the sampled implementations show; those branches are represented at their supported directory paths without asserting unsampled internal calls.
Main entry points: parser.py ConfigParser · l2_interface_parser.py Layer 2 interfaces · l3_interface_parser.py Layer 3 interfaces · parent_child_parser.py Parent-child search
Components 26
Parser entry
- ConfigParser
cisco_config_parser/parser/parser.py - Platform detection regex
cisco_config_parser/parser_regex/ios_regex.py - Device model
cisco_config_parser/parser/parser.py
Interfaces
- Layer 2 interfaces
cisco_config_parser/layer2_interface/l2_interface_parser.py - L2 field parsing
cisco_config_parser/layer2_interface/l2_section_parser.py - L2 interface objects
cisco_config_parser/layer2_interface/l2_interface_obj.py - L2 section splitting
cisco_config_parser/layer2_interface/l2_interface_separator.py - Layer 3 interfaces
cisco_config_parser/layer3_interface/l3_interface_parser.py - L3 field parsing
cisco_config_parser/layer3_interface/l3_section_parser.py - L3 interface objects
cisco_config_parser/layer3_interface/l3_interface_obj.py - L3 section splitting
cisco_config_parser/layer3_interface/l3_interface_separator.py
Configuration parsing
- Parent-child search
cisco_config_parser/parent_child/parent_child_parser.py - Parent-child objects
cisco_config_parser/parent_child/parent_child_obj.py - Parent-child splitting
cisco_config_parser/parent_child/parent_child_separator.py - Global search
cisco_config_parser/global_search/global_parser.py - VLAN and banner objects
cisco_config_parser/global_search/global_obj.py - Global section splitting
cisco_config_parser/global_search/global_separator.py - ConfigTree hierarchy
cisco_config_parser/config_tree/config_tree.py - Shared regex definitions
cisco_config_parser/parser_regex/common_regex.py - Legacy parser
cisco_config_parser/old_version/old_parse.py
Routing protocols
- Platform routing parsers
cisco_config_parser/routing_protocol - IOS routing objects
cisco_config_parser/routing_protocol/ios/rtp_ios_rtp_obj.py
Sections and validation
- Configuration sections
cisco_config_parser/sections - Section objects
cisco_config_parser/sections/section_obj.py - Cross-reference validation
cisco_config_parser/sections/xref.py
Other components
- Automation caller
Connections 24
- Automation caller → ConfigParser: supplies config
- ConfigParser → Platform detection regex: detects platform
cisco_config_parser/parser/parser.py - ConfigParser → Layer 2 interfaces: dispatches parsing
cisco_config_parser/parser/parser.py - ConfigParser → Layer 3 interfaces: dispatches parsing
cisco_config_parser/parser/parser.py - ConfigParser → Parent-child search: dispatches search
cisco_config_parser/parser/parser.py - ConfigParser → Global search: dispatches parsing
cisco_config_parser/parser/parser.py - ConfigParser → Platform routing parsers: selects platform parser
cisco_config_parser/parser/parser.py - ConfigParser → Configuration sections: dispatches sections
cisco_config_parser/parser/parser.py - ConfigParser → Device model: builds model
cisco_config_parser/parser/parser.py - Device model → ConfigTree hierarchy: optionally includes
cisco_config_parser/parser/parser.py - Layer 2 interfaces → L2 section splitting: splits interfaces
cisco_config_parser/layer2_interface/l2_interface_parser.py - Layer 2 interfaces → L2 field parsing: parses custom fields
cisco_config_parser/layer2_interface/l2_interface_parser.py - Layer 2 interfaces → L2 interface objects: creates objects
cisco_config_parser/layer2_interface/l2_interface_parser.py - Layer 3 interfaces → L3 section splitting: splits interfaces
cisco_config_parser/layer3_interface/l3_interface_parser.py - Layer 3 interfaces → L3 field parsing: parses fields
cisco_config_parser/layer3_interface/l3_interface_parser.py - Layer 3 interfaces → L3 interface objects: creates objects
cisco_config_parser/layer3_interface/l3_interface_parser.py - Parent-child search → Parent-child splitting: splits sections
cisco_config_parser/parent_child/parent_child_parser.py - Parent-child search → Parent-child objects: creates objects
cisco_config_parser/parent_child/parent_child_parser.py - Global search → Global section splitting: finds VLAN sections
cisco_config_parser/global_search/global_parser.py - Global search → VLAN and banner objects: creates objects
cisco_config_parser/global_search/global_parser.py - Platform routing parsers → IOS routing objects: uses IOS objects
cisco_config_parser/routing_protocol/ios/rtp_bgp.py - Configuration sections → Section objects: builds section objects
cisco_config_parser/sections/netflow.py - Cross-reference validation → ConfigTree hierarchy: scans hierarchy
cisco_config_parser/sections/xref.py - Legacy parser → Shared regex definitions: uses IOS patterns
cisco_config_parser/old_version/old_parse.py