cisco-config-parser 2.2__tar.gz → 2.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/PKG-INFO +14 -16
  2. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/README.md +12 -14
  3. cisco_config_parser-2.2.1/cisco_config_parser/helper/help.py +122 -0
  4. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/helper/helper.py +4 -1
  5. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser.egg-info/PKG-INFO +14 -16
  6. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/setup.py +2 -2
  7. cisco_config_parser-2.2/cisco_config_parser/helper/help.py +0 -73
  8. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/__init__.py +0 -0
  9. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/cisco_config_parser.py +0 -0
  10. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/global_search/__init__.py +0 -0
  11. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/global_search/global_obj.py +0 -0
  12. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/global_search/global_parser.py +0 -0
  13. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/global_search/global_separator.py +0 -0
  14. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/helper/__init__.py +0 -0
  15. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/layer2_interface/__init__.py +0 -0
  16. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/layer2_interface/l2_interface_obj.py +0 -0
  17. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/layer2_interface/l2_interface_parser.py +0 -0
  18. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/layer2_interface/l2_interface_separator.py +0 -0
  19. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/layer2_interface/l2_section_parser.py +0 -0
  20. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/layer3_interface/__init__.py +0 -0
  21. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/layer3_interface/l3_interface_obj.py +0 -0
  22. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/layer3_interface/l3_interface_parser.py +0 -0
  23. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/layer3_interface/l3_interface_separator.py +0 -0
  24. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/layer3_interface/l3_section_parser.py +0 -0
  25. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/old_version/__init__.py +0 -0
  26. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/old_version/exceptions.py +0 -0
  27. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/old_version/obj.py +0 -0
  28. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/old_version/old_parse.py +0 -0
  29. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/old_version/ssh.py +0 -0
  30. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/old_version/utils.py +0 -0
  31. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/parent_child/__init__.py +0 -0
  32. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/parent_child/parent_child_obj.py +0 -0
  33. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/parent_child/parent_child_parser.py +0 -0
  34. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/parent_child/parent_child_separator.py +0 -0
  35. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/parser/__init__.py +0 -0
  36. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/parser/parser.py +0 -0
  37. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/parser_regex/__init__.py +0 -0
  38. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/parser_regex/regex.py +0 -0
  39. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/routing_protocol/__init__.py +0 -0
  40. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/routing_protocol/rtp_dynamic_obj.py +0 -0
  41. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/routing_protocol/rtp_dynamic_parser.py +0 -0
  42. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/routing_protocol/rtp_ios_obj.py +0 -0
  43. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/routing_protocol/rtp_ios_parser.py +0 -0
  44. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/routing_protocol/rtp_separator.py +0 -0
  45. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/separator/__init__.py +0 -0
  46. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/separator/separator.py +0 -0
  47. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/setup.py +0 -0
  48. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser/testing.py +0 -0
  49. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser.egg-info/SOURCES.txt +0 -0
  50. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser.egg-info/dependency_links.txt +0 -0
  51. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/cisco_config_parser.egg-info/top_level.txt +0 -0
  52. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/pyproject.toml +0 -0
  53. {cisco_config_parser-2.2 → cisco_config_parser-2.2.1}/setup.cfg +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cisco_config_parser
3
- Version: 2.2
4
- Summary: This Package Will Parse Cisco IOS, IOS-XE, IOS-XR and NXOS Configuration File.
3
+ Version: 2.2.1
4
+ Summary: This library is used for Network Automation involving Cisco Routers and Switch. It will parse Cisco IOS, IOS-XE, IOS-XR, and NXOS configuration file into objects and/or json format
5
5
  Home-page: https://github.com/arezazadeh/cisco_config_parser
6
6
  Author: Ahmad Rezazadeh
7
7
  Author-email: ahmad@klevernet.io
@@ -9,10 +9,19 @@ License: MIT License
9
9
  Description-Content-Type: text/markdown
10
10
 
11
11
  # Cisco Configuration Parser
12
- ## This Package Will Parse Cisco IOS, IOS-XE, IOS-XR, and NXOS Configuration File.
13
12
 
13
+ This library is used for Network Automation involving Cisco Routers and Switch. It will parse Cisco IOS, IOS-XE, IOS-XR, and NXOS configuration file into objects and/or json format
14
+
15
+ ## New Version 2.0
16
+
17
+ ## Install the package
18
+
19
+ https://pypi.org/project/cisco-config-parser/
20
+
21
+ ```bash
22
+ pip install cisco-config-parser
23
+ ```
14
24
 
15
- # New Version 2.0
16
25
 
17
26
  ## Classes in this library
18
27
 
@@ -93,9 +102,6 @@ for i in eigrp:
93
102
 
94
103
  ```
95
104
 
96
-
97
-
98
-
99
105
  ### 1. Layer3 Interfaces:
100
106
  - added interface details - returns dict of all layer3 interfaces
101
107
  - methods are unified
@@ -136,7 +142,7 @@ None
136
142
  <hr>
137
143
  <hr>
138
144
 
139
- # Old Version < 2.0
145
+ ## Old Version < 2.0
140
146
 
141
147
  There are two ways to parse the config, 1, SSH which is not recommended, and 2, feeding the running-config file
142
148
 
@@ -169,14 +175,6 @@ pass the kwargs then it will login to your device and does the `show running-con
169
175
 
170
176
  **if you select `json=True` then the object will return the result in json format. else, it would return as list of objects.**
171
177
 
172
- ## Install the package
173
-
174
- https://pypi.org/project/cisco-config-parser/
175
-
176
- ```ruby
177
- pip install cisco-config-parser
178
- ```
179
-
180
178
 
181
179
  ## Regex Search Strings:
182
180
 
@@ -1,8 +1,17 @@
1
1
  # Cisco Configuration Parser
2
- ## This Package Will Parse Cisco IOS, IOS-XE, IOS-XR, and NXOS Configuration File.
3
2
 
3
+ This library is used for Network Automation involving Cisco Routers and Switch. It will parse Cisco IOS, IOS-XE, IOS-XR, and NXOS configuration file into objects and/or json format
4
+
5
+ ## New Version 2.0
6
+
7
+ ## Install the package
8
+
9
+ https://pypi.org/project/cisco-config-parser/
10
+
11
+ ```bash
12
+ pip install cisco-config-parser
13
+ ```
4
14
 
5
- # New Version 2.0
6
15
 
7
16
  ## Classes in this library
8
17
 
@@ -83,9 +92,6 @@ for i in eigrp:
83
92
 
84
93
  ```
85
94
 
86
-
87
-
88
-
89
95
  ### 1. Layer3 Interfaces:
90
96
  - added interface details - returns dict of all layer3 interfaces
91
97
  - methods are unified
@@ -126,7 +132,7 @@ None
126
132
  <hr>
127
133
  <hr>
128
134
 
129
- # Old Version < 2.0
135
+ ## Old Version < 2.0
130
136
 
131
137
  There are two ways to parse the config, 1, SSH which is not recommended, and 2, feeding the running-config file
132
138
 
@@ -159,14 +165,6 @@ pass the kwargs then it will login to your device and does the `show running-con
159
165
 
160
166
  **if you select `json=True` then the object will return the result in json format. else, it would return as list of objects.**
161
167
 
162
- ## Install the package
163
-
164
- https://pypi.org/project/cisco-config-parser/
165
-
166
- ```ruby
167
- pip install cisco-config-parser
168
- ```
169
-
170
168
 
171
169
  ## Regex Search Strings:
172
170
 
@@ -0,0 +1,122 @@
1
+
2
+
3
+ RTP_IOS_HELP = """
4
+
5
+ Example Usage:
6
+ ====================================================================================================
7
+
8
+ with open("show_run.txt", "r") as file_output:
9
+ content = file_output.read()
10
+
11
+
12
+ obj = ConfigParser(content)
13
+
14
+
15
+ #
16
+ ##
17
+ ###
18
+ #### Static Routes Example:
19
+ ###
20
+ ##
21
+ #
22
+ obj.get_static_routes()
23
+ obj.get_static_routes(return_json=True)
24
+
25
+
26
+ #
27
+ ##
28
+ ###
29
+ #### OSPF Example:
30
+ ###
31
+ ##
32
+ #
33
+ ospf = obj.get_ospf_config(return_json=True)
34
+ ospf = obj.get_ospf_config()
35
+ for i in ospf:
36
+ print(i.children)
37
+ print(i.network)
38
+ print(i.no_passive_interface)
39
+
40
+ #
41
+ ##
42
+ ###
43
+ #### EIGRP Example:
44
+ ###
45
+ ##
46
+ #
47
+ eigrp = obj.get_eigrp_config(return_json=True)
48
+ eigrp = obj.get_eigrp_config()
49
+ for i in eigrp:
50
+ print(i.children)
51
+ print(i.network)
52
+ print(i.vrf_children) << returns a list of EIGRPVrfChildren objects
53
+ vrf_children = i.vrf_children
54
+ for vrf in vrf_children:
55
+ print(vrf.network)
56
+ print(vrf.children)
57
+ """
58
+ PARENT_CHILD_HELP = """
59
+ Example Usage:
60
+ ====================================================================================================
61
+
62
+ with open("show_run.txt", "r") as file_output:
63
+ content = file_output.read()
64
+
65
+ obj = ConfigParser(content)
66
+
67
+ parent_child = obj.get_parent_child(custom_regex="(^snmp.*)|(^aaa.*)")
68
+
69
+ for i in parent_child:
70
+ print(i.parent)
71
+ print(i.children)
72
+
73
+ """
74
+ LAYER3_INTERFACE_HELP = """
75
+ Example Usage:
76
+ ====================================================================================================
77
+ with open("show_run.txt", "r") as file_output:
78
+ content = file_output.read()
79
+
80
+ obj = ConfigParser(content)
81
+
82
+ # returns dictionary of layer3 interfaces
83
+ l3_intfs = obj.get_l3_interface_details()
84
+
85
+ l3_intfs = obj.get_l3_interface()
86
+
87
+ for intf in l3_intfs:
88
+ print(intf.name)
89
+ print(intf.ip_address)
90
+ print(intf.children)
91
+
92
+
93
+ # you can also search for specific entry under layer3 interface with custom regex
94
+ l3_intfs = obj.get_l3_interface(ip_pim="(ip\spim\s.*)", load_interval="(load\sinterval.*)")
95
+
96
+
97
+ for intf in l3_intfs:
98
+ print(intf.name)
99
+ print(intf.ip_address)
100
+ print(intf.ip_pim) <<< dynamically creates an attribute based on the custom regex
101
+ print(intf.load_interval) <<< dynamically creates an attribute based on the custom regex
102
+
103
+ """
104
+
105
+ LAYER2_INTERFACE_HELP = """
106
+ Example Usage:
107
+ ====================================================================================================
108
+ with open("show_run.txt", "r") as file_output:
109
+ content = file_output.read()
110
+
111
+ obj = ConfigParser(content)
112
+
113
+ # returns dictionary of layer2 interfaces
114
+ l2_intfs = obj.get_l2_interface_details()
115
+
116
+ l2_intfs = obj.get_l2_interface()
117
+
118
+ for intf in l2_intfs:
119
+ print(intf.name)
120
+ print(intf.children)
121
+
122
+ """
@@ -14,9 +14,12 @@ class ParentChild:
14
14
 
15
15
  class L3Interface:
16
16
  def __repr__(self):
17
- return "L3 Interface Usage"
17
+ return LAYER3_INTERFACE_HELP
18
18
 
19
19
 
20
+ class L2Interface:
21
+ def __repr__(self):
22
+ return LAYER2_INTERFACE_HELP
20
23
 
21
24
 
22
25
 
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cisco-config-parser
3
- Version: 2.2
4
- Summary: This Package Will Parse Cisco IOS, IOS-XE, IOS-XR and NXOS Configuration File.
3
+ Version: 2.2.1
4
+ Summary: This library is used for Network Automation involving Cisco Routers and Switch. It will parse Cisco IOS, IOS-XE, IOS-XR, and NXOS configuration file into objects and/or json format
5
5
  Home-page: https://github.com/arezazadeh/cisco_config_parser
6
6
  Author: Ahmad Rezazadeh
7
7
  Author-email: ahmad@klevernet.io
@@ -9,10 +9,19 @@ License: MIT License
9
9
  Description-Content-Type: text/markdown
10
10
 
11
11
  # Cisco Configuration Parser
12
- ## This Package Will Parse Cisco IOS, IOS-XE, IOS-XR, and NXOS Configuration File.
13
12
 
13
+ This library is used for Network Automation involving Cisco Routers and Switch. It will parse Cisco IOS, IOS-XE, IOS-XR, and NXOS configuration file into objects and/or json format
14
+
15
+ ## New Version 2.0
16
+
17
+ ## Install the package
18
+
19
+ https://pypi.org/project/cisco-config-parser/
20
+
21
+ ```bash
22
+ pip install cisco-config-parser
23
+ ```
14
24
 
15
- # New Version 2.0
16
25
 
17
26
  ## Classes in this library
18
27
 
@@ -93,9 +102,6 @@ for i in eigrp:
93
102
 
94
103
  ```
95
104
 
96
-
97
-
98
-
99
105
  ### 1. Layer3 Interfaces:
100
106
  - added interface details - returns dict of all layer3 interfaces
101
107
  - methods are unified
@@ -136,7 +142,7 @@ None
136
142
  <hr>
137
143
  <hr>
138
144
 
139
- # Old Version < 2.0
145
+ ## Old Version < 2.0
140
146
 
141
147
  There are two ways to parse the config, 1, SSH which is not recommended, and 2, feeding the running-config file
142
148
 
@@ -169,14 +175,6 @@ pass the kwargs then it will login to your device and does the `show running-con
169
175
 
170
176
  **if you select `json=True` then the object will return the result in json format. else, it would return as list of objects.**
171
177
 
172
- ## Install the package
173
-
174
- https://pypi.org/project/cisco-config-parser/
175
-
176
- ```ruby
177
- pip install cisco-config-parser
178
- ```
179
-
180
178
 
181
179
  ## Regex Search Strings:
182
180
 
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
3
3
 
4
4
  HERE = pathlib.Path(__file__).parent
5
5
 
6
- VERSION = '2.2'
6
+ VERSION = '2.2.1'
7
7
  PACKAGE_NAME = 'cisco_config_parser'
8
8
  AUTHOR = 'Ahmad Rezazadeh'
9
9
  AUTHOR_EMAIL = 'ahmad@klevernet.io'
@@ -11,7 +11,7 @@ AUTHOR_EMAIL = 'ahmad@klevernet.io'
11
11
  URL = 'https://github.com/arezazadeh/cisco_config_parser'
12
12
 
13
13
  LICENSE = 'MIT License'
14
- DESCRIPTION = 'This Package Will Parse Cisco IOS, IOS-XE, IOS-XR and NXOS Configuration File.'
14
+ DESCRIPTION = 'This library is used for Network Automation involving Cisco Routers and Switch. It will parse Cisco IOS, IOS-XE, IOS-XR, and NXOS configuration file into objects and/or json format'
15
15
  LONG_DESCRIPTION = (HERE / "README.md").read_text()
16
16
  LONG_DESC_TYPE = "text/markdown"
17
17
 
@@ -1,73 +0,0 @@
1
-
2
-
3
- RTP_IOS_HELP = """
4
-
5
- Example Usage:
6
- ====================================================================================================
7
-
8
- with open("show_run.txt", "r") as file_output:
9
- content = file_output.read()
10
-
11
-
12
- obj = ConfigParser(content)
13
-
14
-
15
- #
16
- ##
17
- ###
18
- #### Static Routes Example:
19
- ###
20
- ##
21
- #
22
- obj.get_static_routes()
23
- obj.get_static_routes(return_json=True)
24
-
25
-
26
- #
27
- ##
28
- ###
29
- #### OSPF Example:
30
- ###
31
- ##
32
- #
33
- ospf = obj.get_ospf_config(return_json=True)
34
- ospf = obj.get_ospf_config()
35
- for i in ospf:
36
- print(i.children)
37
- print(i.network)
38
- print(i.no_passive_interface)
39
-
40
- #
41
- ##
42
- ###
43
- #### EIGRP Example:
44
- ###
45
- ##
46
- #
47
- eigrp = obj.get_eigrp_config(return_json=True)
48
- eigrp = obj.get_eigrp_config()
49
- for i in eigrp:
50
- print(i.children)
51
- print(i.network)
52
- print(i.vrf_children) << returns a list of EIGRPVrfChildren objects
53
- vrf_children = i.vrf_children
54
- for vrf in vrf_children:
55
- print(vrf.network)
56
- print(vrf.children)
57
- """
58
- PARENT_CHILD_HELP = """
59
- Example Usage:
60
- ====================================================================================================
61
-
62
- with open("show_run.txt", "r") as file_output:
63
- content = file_output.read()
64
-
65
- obj = ConfigParser(content)
66
-
67
- parent_child = obj.get_parent_child(custom_regex="(^snmp.*)|(^aaa.*)")
68
-
69
- for i in parent_child:
70
- print(i.parent)
71
- print(i.children)
72
-
73
- """