Name | netmiko JSON |
Version |
4.4.0
JSON |
| download |
home_page | https://github.com/ktbyers/netmiko |
Summary | Multi-vendor library to simplify legacy CLI connections to network devices |
upload_time | 2024-07-08 22:18:28 |
maintainer | None |
docs_url | None |
author | Kirk Byers |
requires_python | <4.0,>=3.8 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/netmiko.svg)](https://img.shields.io/pypi/pyversions/netmiko)
[![PyPI](https://img.shields.io/pypi/v/netmiko.svg)](https://pypi.python.org/pypi/netmiko)
[![Downloads](https://static.pepy.tech/badge/netmiko)](https://static.pepy.tech/badge/netmiko)
[![GitHub contributors](https://img.shields.io/github/contributors/ktbyers/netmiko.svg)](https://GitHub.com/ktbyers/netmiko/graphs/contributors/)
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
<img src="https://ktbyers.github.io/netmiko/images/netmiko_logo_gh.png" width="320">
Netmiko
=======
Multi-vendor library to simplify CLI connections to network devices
<br />
## Contributing to Netmiko
[CONTRIBUTING.md](https://github.com/ktbyers/netmiko/blob/develop/CONTRIBUTING.md)
<br />
## Why Netmiko?
Network automation to screen-scraping devices is primarily concerned with gathering output from show commands and with making configuration changes.
Netmiko aims to accomplish both of these operations and to do it across a very broad set of platforms. It seeks to do this while abstracting away low-level state control (i.e. eliminate low-level regex pattern matching to the extent practical).
<br />
## Getting Started
- [Getting Started](#getting-started-1)
<br />
## Examples
*You really should look here.*
- [Netmiko Examples](https://github.com/ktbyers/netmiko/blob/develop/EXAMPLES.md)
<br />
## Supported Platforms
[PLATFORMS](PLATFORMS.md)
<br />
## Installation
To install netmiko, simply us pip:
```
$ pip install netmiko
```
<br />
## API-Documentation
[API-Documentation](https://ktbyers.github.io/netmiko/docs/netmiko/index.html)
<br />
## Common Issues/FAQ
Answers to some [common questions](COMMON_ISSUES.md)
<br />
### Tutorials
- [Netmiko Overview](https://pynet.twb-tech.com/blog/automation/netmiko.html)
- [Secure Copy](https://pynet.twb-tech.com/blog/automation/netmiko-scp.html)
- [Netmiko through SSH Proxy](https://pynet.twb-tech.com/blog/automation/netmiko-proxy.html)
- [Netmiko and TextFSM](https://pynet.twb-tech.com/blog/automation/netmiko-textfsm.html)
- [Netmiko and what constitutes done](https://pynet.twb-tech.com/blog/automation/netmiko-what-is-done.html)
<br />
### Getting Started:
#### Create a dictionary representing the device.
Supported device_types can be found in [ssh_dispatcher.py](https://github.com/ktbyers/netmiko/blob/master/netmiko/ssh_dispatcher.py), see CLASS_MAPPER keys.
```py
from netmiko import ConnectHandler
cisco_881 = {
'device_type': 'cisco_ios',
'host': '10.10.10.10',
'username': 'test',
'password': 'password',
'port' : 8022, # optional, defaults to 22
'secret': 'secret', # optional, defaults to ''
}
```
#### Establish an SSH connection to the device by passing in the device dictionary.
```py
net_connect = ConnectHandler(**cisco_881)
```
#### Execute show commands.
```py
output = net_connect.send_command('show ip int brief')
print(output)
```
```
Interface IP-Address OK? Method Status Protocol
FastEthernet0 unassigned YES unset down down
FastEthernet1 unassigned YES unset down down
FastEthernet2 unassigned YES unset down down
FastEthernet3 unassigned YES unset down down
FastEthernet4 10.10.10.10 YES manual up up
Vlan1 unassigned YES unset down down
```
#### Execute configuration change commands (will automatically enter into config mode)
```py
config_commands = [ 'logging buffered 20000',
'logging buffered 20010',
'no logging console' ]
output = net_connect.send_config_set(config_commands)
print(output)
```
```
pynet-rtr1#config term
Enter configuration commands, one per line. End with CNTL/Z.
pynet-rtr1(config)#logging buffered 20000
pynet-rtr1(config)#logging buffered 20010
pynet-rtr1(config)#no logging console
pynet-rtr1(config)#end
pynet-rtr1#
```
<br />
## API-Documentation
<a href="https://ktbyers.github.io/netmiko/docs/netmiko/index.html" title="Docs">API Documentation</a>
Below are some of the particularly handy Classes/functions for easy reference:
- [Base Connection Object](https://ktbyers.github.io/netmiko/docs/netmiko/base_connection.html)
- [SSH Autodetect](https://ktbyers.github.io/netmiko/docs/netmiko/index.html#netmiko.SSHDetect)
- [SSH Dispatcher](https://ktbyers.github.io/netmiko/docs/netmiko/index.html#netmiko.ssh_dispatcher)
- [Redispatch](https://ktbyers.github.io/netmiko/docs/netmiko/index.html#netmiko.redispatch)
<br />
## Contributing
Contributors are welcome.
You can contribute to Netmiko in a variety of ways: answering questions on Slack (see below in Questions/Discussions), responding to issues, adding to the common issues, reporting/fixing bugs, or even adding your own device type.
Before contributing a new vendor/platform device type, remember that any code added needs to be supported in some fashion. To add a vendor/platform you can follow the outline [here](VENDOR.md). Once you've worked on your first pass of your driver and have it functional, you'll need to include test data in order for it to be merged into develop, you can see the general flow of how to do that [here](TESTING.md).
For all code contributions, please ensure that you have ran `black` against the code or your code will fail the Travis CI build.
<br />
## Questions/Discussion
If you find an issue with Netmiko, then you can open an issue on this projects issue page here: [https://github.com/ktbyers/netmiko/issues](https://github.com/ktbyers/netmiko/issues). Please make sure you've read through the common issues and examples prior to opening an issue. Please only open issues for bugs, feature requests, or other topics related to development of Netmiko. If you simply have a question, join us on Slack...
If you have questions or would like to discuss Netmiko, a #netmiko channel exists in [this Slack](https://pynet.slack.com) workspace. To join, use [this invitation](https://join.slack.com/t/pynet/shared_invite/zt-km2k3upf-AkWHY4YEx3sI1R5irMmc7Q). Once you have entered the workspace, then you can join the #netmiko channel.
---
Kirk Byers
Python for Network Engineers
https://pynet.twb-tech.com
Raw data
{
"_id": null,
"home_page": "https://github.com/ktbyers/netmiko",
"name": "netmiko",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Kirk Byers",
"author_email": "ktbyers@twb-tech.com",
"download_url": "https://files.pythonhosted.org/packages/f2/8c/a857bd61afed60f5397b28a8d15de47b10f0777cfd9d623af229ec4010ce/netmiko-4.4.0.tar.gz",
"platform": null,
"description": "[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/netmiko.svg)](https://img.shields.io/pypi/pyversions/netmiko)\n[![PyPI](https://img.shields.io/pypi/v/netmiko.svg)](https://pypi.python.org/pypi/netmiko)\n[![Downloads](https://static.pepy.tech/badge/netmiko)](https://static.pepy.tech/badge/netmiko)\n[![GitHub contributors](https://img.shields.io/github/contributors/ktbyers/netmiko.svg)](https://GitHub.com/ktbyers/netmiko/graphs/contributors/)\n[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\n<img src=\"https://ktbyers.github.io/netmiko/images/netmiko_logo_gh.png\" width=\"320\">\n\nNetmiko\n=======\n\nMulti-vendor library to simplify CLI connections to network devices\n\n<br />\n\n## Contributing to Netmiko\n\n[CONTRIBUTING.md](https://github.com/ktbyers/netmiko/blob/develop/CONTRIBUTING.md)\n\n<br />\n\n## Why Netmiko?\nNetwork automation to screen-scraping devices is primarily concerned with gathering output from show commands and with making configuration changes.\n\nNetmiko aims to accomplish both of these operations and to do it across a very broad set of platforms. It seeks to do this while abstracting away low-level state control (i.e. eliminate low-level regex pattern matching to the extent practical).\n\n<br />\n\n## Getting Started\n- [Getting Started](#getting-started-1)\n\n<br />\n\n## Examples\n*You really should look here.*\n\n- [Netmiko Examples](https://github.com/ktbyers/netmiko/blob/develop/EXAMPLES.md)\n\n<br />\n\n\n## Supported Platforms\n\n[PLATFORMS](PLATFORMS.md)\n\n<br />\n\n\n## Installation\n\nTo install netmiko, simply us pip:\n\n```\n$ pip install netmiko\n```\n\n<br />\n\n## API-Documentation\n\n[API-Documentation](https://ktbyers.github.io/netmiko/docs/netmiko/index.html)\n\n<br />\n\n## Common Issues/FAQ\n\nAnswers to some [common questions](COMMON_ISSUES.md)\n\n<br />\n\n### Tutorials\n\n- [Netmiko Overview](https://pynet.twb-tech.com/blog/automation/netmiko.html)\n- [Secure Copy](https://pynet.twb-tech.com/blog/automation/netmiko-scp.html)\n- [Netmiko through SSH Proxy](https://pynet.twb-tech.com/blog/automation/netmiko-proxy.html)\n- [Netmiko and TextFSM](https://pynet.twb-tech.com/blog/automation/netmiko-textfsm.html)\n- [Netmiko and what constitutes done](https://pynet.twb-tech.com/blog/automation/netmiko-what-is-done.html)\n\n<br />\n\n### Getting Started:\n\n#### Create a dictionary representing the device.\n\nSupported device_types can be found in [ssh_dispatcher.py](https://github.com/ktbyers/netmiko/blob/master/netmiko/ssh_dispatcher.py), see CLASS_MAPPER keys.\n```py\nfrom netmiko import ConnectHandler\n\ncisco_881 = {\n 'device_type': 'cisco_ios',\n 'host': '10.10.10.10',\n 'username': 'test',\n 'password': 'password',\n 'port' : 8022, # optional, defaults to 22\n 'secret': 'secret', # optional, defaults to ''\n}\n\n```\n\n#### Establish an SSH connection to the device by passing in the device dictionary.\n\n```py\nnet_connect = ConnectHandler(**cisco_881)\n```\n\n#### Execute show commands.\n\n```py\noutput = net_connect.send_command('show ip int brief')\nprint(output)\n```\n```\nInterface IP-Address OK? Method Status Protocol\nFastEthernet0 unassigned YES unset down down\nFastEthernet1 unassigned YES unset down down\nFastEthernet2 unassigned YES unset down down\nFastEthernet3 unassigned YES unset down down\nFastEthernet4 10.10.10.10 YES manual up up\nVlan1 unassigned YES unset down down\n```\n\n#### Execute configuration change commands (will automatically enter into config mode)\n\n```py\nconfig_commands = [ 'logging buffered 20000',\n 'logging buffered 20010',\n 'no logging console' ]\noutput = net_connect.send_config_set(config_commands)\nprint(output)\n```\n```\npynet-rtr1#config term\nEnter configuration commands, one per line. End with CNTL/Z.\npynet-rtr1(config)#logging buffered 20000\npynet-rtr1(config)#logging buffered 20010\npynet-rtr1(config)#no logging console\npynet-rtr1(config)#end\npynet-rtr1#\n```\n\n<br />\n\n## API-Documentation\n\n<a href=\"https://ktbyers.github.io/netmiko/docs/netmiko/index.html\" title=\"Docs\">API Documentation</a>\n\nBelow are some of the particularly handy Classes/functions for easy reference:\n- [Base Connection Object](https://ktbyers.github.io/netmiko/docs/netmiko/base_connection.html)\n- [SSH Autodetect](https://ktbyers.github.io/netmiko/docs/netmiko/index.html#netmiko.SSHDetect)\n- [SSH Dispatcher](https://ktbyers.github.io/netmiko/docs/netmiko/index.html#netmiko.ssh_dispatcher)\n- [Redispatch](https://ktbyers.github.io/netmiko/docs/netmiko/index.html#netmiko.redispatch)\n\n<br />\n\n## Contributing\n\nContributors are welcome.\n\nYou can contribute to Netmiko in a variety of ways: answering questions on Slack (see below in Questions/Discussions), responding to issues, adding to the common issues, reporting/fixing bugs, or even adding your own device type.\n\nBefore contributing a new vendor/platform device type, remember that any code added needs to be supported in some fashion. To add a vendor/platform you can follow the outline [here](VENDOR.md). Once you've worked on your first pass of your driver and have it functional, you'll need to include test data in order for it to be merged into develop, you can see the general flow of how to do that [here](TESTING.md).\n\nFor all code contributions, please ensure that you have ran `black` against the code or your code will fail the Travis CI build.\n\n<br />\n\n## Questions/Discussion\n\nIf you find an issue with Netmiko, then you can open an issue on this projects issue page here: [https://github.com/ktbyers/netmiko/issues](https://github.com/ktbyers/netmiko/issues). Please make sure you've read through the common issues and examples prior to opening an issue. Please only open issues for bugs, feature requests, or other topics related to development of Netmiko. If you simply have a question, join us on Slack...\n\nIf you have questions or would like to discuss Netmiko, a #netmiko channel exists in [this Slack](https://pynet.slack.com) workspace. To join, use [this invitation](https://join.slack.com/t/pynet/shared_invite/zt-km2k3upf-AkWHY4YEx3sI1R5irMmc7Q). Once you have entered the workspace, then you can join the #netmiko channel.\n\n\n---\nKirk Byers \nPython for Network Engineers \nhttps://pynet.twb-tech.com \n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Multi-vendor library to simplify legacy CLI connections to network devices",
"version": "4.4.0",
"project_urls": {
"Homepage": "https://github.com/ktbyers/netmiko",
"Repository": "https://github.com/ktbyers/netmiko"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "89c104060c529da57c4736ff01450a64d9d9385c2fa79d03d53202bbce45871d",
"md5": "d4535d82c62d54fc93b22a434da5ec42",
"sha256": "2ff4683f013fac0f80715286c7d3250e89166aefc4421cb75d3ff483f2ebbbc0"
},
"downloads": -1,
"filename": "netmiko-4.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d4535d82c62d54fc93b22a434da5ec42",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 232236,
"upload_time": "2024-07-08T22:18:26",
"upload_time_iso_8601": "2024-07-08T22:18:26.788089Z",
"url": "https://files.pythonhosted.org/packages/89/c1/04060c529da57c4736ff01450a64d9d9385c2fa79d03d53202bbce45871d/netmiko-4.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f28ca857bd61afed60f5397b28a8d15de47b10f0777cfd9d623af229ec4010ce",
"md5": "6a2f0562b985a872832296d074ab1ca6",
"sha256": "25ff1237976aa3ff2cacf04949314638c899220a1675bd029e31b07ce20ce3b6"
},
"downloads": -1,
"filename": "netmiko-4.4.0.tar.gz",
"has_sig": false,
"md5_digest": "6a2f0562b985a872832296d074ab1ca6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 151320,
"upload_time": "2024-07-08T22:18:28",
"upload_time_iso_8601": "2024-07-08T22:18:28.642226Z",
"url": "https://files.pythonhosted.org/packages/f2/8c/a857bd61afed60f5397b28a8d15de47b10f0777cfd9d623af229ec4010ce/netmiko-4.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-08 22:18:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ktbyers",
"github_project": "netmiko",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "netmiko"
}