Package conn
+Package connpy
Connection manager
-conn is a connection manager that allows you to store nodes to connect them fast and password free.
+Connpy is a connection manager that allows you to store nodes to connect them fast and password free.
Features
- You can generate profiles and reference them from nodes using @profilename
so you dont need to edit multiple nodes when changing password or other
@@ -83,8 +83,8 @@ options:
Automation module
the automation module
Standalone module
-import conn
-router = conn.node("unique name","ip/hostname", user="username", password="pass")
+import connpy
+router = connpy.node("unique name","ip/hostname", user="username", password="pass")
router.run(["term len 0","show run"])
print(router.output)
hasip = router.test("show ip int brief","1.1.1.1")
@@ -94,16 +94,16 @@ else:
print("router don't has ip 1.1.1.1")
Using manager configuration
-import conn
-conf = conn.configfile()
+import connpy
+conf = connpy.configfile()
device = conf.getitem("server@office")
-server = conn.node("unique name", **device, config=conf)
+server = connpy.node("unique name", **device, config=conf)
result = server.run(["cd /", "ls -la"])
print(result)
Running parallel tasks
-import conn
-conf = conn.configfile()
+import connpy
+conf = connpy.configfile()
#You can get the nodes from the config from a folder and fitlering in it
nodes = conf.getitem("@office", ["router1", "router2", "router3"])
#You can also get each node individually:
@@ -117,7 +117,7 @@ nodes["router1"] = {"host": "1.1.1.1", "user&
nodes["router2"] = {"host": "1.1.1.2", "user": "username", "password": "pass2"}
nodes["router3"] = {"host": "1.1.1.2", "user": "username", "password": "pass3"}
#Finally you run some tasks on the nodes
-mynodes = conn.nodes(nodes, config = conf)
+mynodes = connpy.nodes(nodes, config = conf)
result = mynodes.test(["show ip int br"], "1.1.1.2")
for i in result:
print("---" + i + "---")
@@ -134,7 +134,7 @@ mynodes.router1.run(["term len 0". "show run"], folder = &qu
'''
## Connection manager
-conn is a connection manager that allows you to store nodes to connect them fast and password free.
+Connpy is a connection manager that allows you to store nodes to connect them fast and password free.
### Features
- You can generate profiles and reference them from nodes using @profilename
@@ -203,8 +203,8 @@ the automation module
### Standalone module
```
-import conn
-router = conn.node("unique name","ip/hostname", user="username", password="pass")
+import connpy
+router = connpy.node("unique name","ip/hostname", user="username", password="pass")
router.run(["term len 0","show run"])
print(router.output)
hasip = router.test("show ip int brief","1.1.1.1")
@@ -216,17 +216,17 @@ else:
### Using manager configuration
```
-import conn
-conf = conn.configfile()
+import connpy
+conf = connpy.configfile()
device = conf.getitem("server@office")
-server = conn.node("unique name", **device, config=conf)
+server = connpy.node("unique name", **device, config=conf)
result = server.run(["cd /", "ls -la"])
print(result)
```
### Running parallel tasks
```
-import conn
-conf = conn.configfile()
+import connpy
+conf = connpy.configfile()
#You can get the nodes from the config from a folder and fitlering in it
nodes = conf.getitem("@office", ["router1", "router2", "router3"])
#You can also get each node individually:
@@ -240,7 +240,7 @@ nodes["router1"] = {"host": "1.1.1.1", "user": &
nodes["router2"] = {"host": "1.1.1.2", "user": "username", "password": "pass2"}
nodes["router3"] = {"host": "1.1.1.2", "user": "username", "password": "pass3"}
#Finally you run some tasks on the nodes
-mynodes = conn.nodes(nodes, config = conf)
+mynodes = connpy.nodes(nodes, config = conf)
result = mynodes.test(["show ip int br"], "1.1.1.2")
for i in result:
print("---" + i + "---")
@@ -273,7 +273,7 @@ __pdoc__ = {
Classes
-
+
class configfile
(conf=None, key=None)
@@ -522,7 +522,7 @@ __pdoc__ = {
Methods
-
+
def getitem(self, unique, keys=None)
-
@@ -595,7 +595,7 @@ __pdoc__ = {
-
+
class connapp
(config)
@@ -1392,7 +1392,7 @@ complete -o nosort -F _conn conn
Methods
-
+
def encrypt(self, password, keyfile=None)
-
@@ -1439,7 +1439,7 @@ complete -o nosort -F _conn conn
-
+
class node
(unique, host, options='', logs='', password='', port='', protocol='', user='', config='')
@@ -1852,7 +1852,7 @@ complete -o nosort -F _conn conn
Methods
-
+
def interact(self, debug=False)
-
@@ -1893,7 +1893,7 @@ complete -o nosort -F _conn conn
exit(1)
-
+
def run(self, commands, *, folder='', prompt='>$|#$|\\$$|>.$|#.$|\\$.$', stdout=False)
@@ -1990,7 +1990,7 @@ complete -o nosort -F _conn conn
return connect
-
+
def test(self, commands, expected, *, prompt='>$|#$|\\$$|>.$|#.$|\\$.$')
@@ -2085,7 +2085,7 @@ complete -o nosort -F _conn conn
-
+
class nodes
(nodes: dict, config='')
@@ -2285,7 +2285,7 @@ complete -o nosort -F _conn conn
Methods
-
+
def run(self, commands, *, folder=None, prompt=None, stdout=None, parallel=10)
-
@@ -2378,7 +2378,7 @@ parallel (int): Number of nodes to run the commands simultaneously.
return output
-
+
def test(self, commands, expected, *, prompt=None, parallel=10)
@@ -2485,30 +2485,30 @@ expected (str) : Expected text to appear after running all the
Classes
diff --git a/docs/index.html b/docs/index.html
index c5730e4..ab5bc4a 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -2,7 +2,7 @@
-
+
diff --git a/setup.cfg b/setup.cfg
index f2e45cd..1c25717 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,7 +1,7 @@
[metadata]
-name = conn
-version = attr: conn.__version__
-description = Conn is a SSH/Telnet connection manager and automation module
+name = connpy
+version = attr: connpy.__version__
+description = Connpy is a SSH/Telnet connection manager and automation module
long_description = file: README.md
long_description_content_type = text/markdown
keywords = networking, automation, ssh, telnet, connection manager
@@ -31,4 +31,5 @@ install_requires =
[options.entry_points]
console_scripts =
- conn = conn.__main__:main
+ conn = connpy.__main__:main
+ connpy = connpy.__main__:main