Multi-vendor library to simplify Paramiko SSH connections to network devices
  • Python 97.8%
  • Shell 2.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Kirk Byers 8ace5f2ae7
Make ruamel.yaml optional (#3878)
* Make ruamel.yaml optional

Netmiko currently declares ruamel.yaml as a mandatory dependency even though it is only required by specific functionality. This unnecessarily forces consumers such as Netlab to install ruamel when using Netmiko for normal network-device configuration. Make the dependency optional while keeping it available to the functionality that requires it. Update the development/test dependencies so Netmiko's own CI and pre-commit tests continue to run.

* Update cryptography to 50.0.0

* Add bulk-encrypt test coverage; regenerate uv.lock from verified pyproject.toml

Tests: add coverage for netmiko_bulk_encrypt _get_yaml() return path,
stdout output branch, password+secret encryption, non-dict entry skip,
credential-less device pass-through, and main() success path.

Lock: independently regenerated uv.lock from the verified pyproject.toml
(cryptography 50.0.0) rather than trusting the PR-provided lock.

---------

Co-authored-by: Jeroen van Bemmel <jvb127@gmail.com>
2026-08-18 12:48:08 -07:00
.github Fix Palo Alto command echo stripping (#3873) 2026-07-23 14:34:29 -07:00
docs Doc update (#3849) 2026-05-11 18:05:59 -07:00
examples Eliminate Python 'black' and convert over to 'ruff format' (#3785) 2026-03-11 11:11:11 -07:00
examples_old Eliminate Python 'black' and convert over to 'ruff format' (#3785) 2026-03-11 11:11:11 -07:00
images Netpicker and Slurp'it Logos and Sponsors (#3603) 2025-03-05 10:16:42 -08:00
netmiko Make ruamel.yaml optional (#3878) 2026-08-18 12:48:08 -07:00
tests Make ruamel.yaml optional (#3878) 2026-08-18 12:48:08 -07:00
.gitignore chore: add bandit, pip-audit, pytest-cov; fix B324 hashlib MD5 issues (#3860) 2026-06-22 14:08:08 -06:00
_config.yml Set theme jekyll-theme-cayman 2020-07-04 22:32:45 -07:00
_release.sh Replace pylama with ruff check (#3783) 2026-03-11 08:34:31 -07:00
COMMON_ISSUES.md Add poetry install process for Netmiko 'develop' branch (#3174) 2023-05-05 09:29:22 -07:00
CONTRIBUTING.md chore: migrate from poetry to uv 2026-06-22 10:15:54 -07:00
ENCRYPTION_HANDLING.md Adding working doc explaining the encryption handling process (#3533) 2024-11-11 11:00:38 -08:00
EXAMPLES.md Update EXAMPLES.md 2025-03-28 11:30:38 -07:00
LICENSE Updating copyright year 2016-01-18 10:12:35 -08:00
license-dependencies.txt Vendor telnetlib library internally to Netmiko (#3444) 2024-06-26 13:39:40 -06:00
PLATFORMS.md Merge branch 'master' into develop 2026-05-12 11:04:56 -07:00
pyproject.toml Make ruamel.yaml optional (#3878) 2026-08-18 12:48:08 -07:00
README.md Fix broken image URLs in README for PyPI rendering (#3824) 2026-04-14 10:46:58 -07:00
release_process.txt Add py.typed and fix include/MANIFEST.in issues (#3723) 2025-08-27 18:50:00 -07:00
TESTING.md Updates to TESTING.md 2017-07-10 13:00:23 -07:00
tests.sh chore: migrate from poetry to uv 2026-06-22 10:15:54 -07:00
uv.lock Make ruamel.yaml optional (#3878) 2026-08-18 12:48:08 -07:00
VENDOR.md Fix ugly markdown 2017-06-26 16:03:26 -07:00

PyPI - Python Version PyPI Downloads GitHub contributors Ruff

Netmiko

Multi-vendor library to simplify CLI connections to network devices


Contributing to Netmiko

CONTRIBUTING.md


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).


Getting Started


Examples

You really should look here.


Supported Platforms

PLATFORMS


Installation

To install netmiko, simply use pip:

$ pip install netmiko

API-Documentation

API-Documentation


Common Issues/FAQ

Answers to some common_questions


Tutorials


Getting Started:

Create a dictionary representing the device.

Supported device_types can be found in ssh_dispatcher.py, see CLASS_MAPPER keys.

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.

net_connect = ConnectHandler(**cisco_881)

Execute show commands.

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)

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#

API-Documentation

API Documentation

Below are some of the particularly handy Classes/functions for easy reference:


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. 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.

For all code contributions, please ensure that you have ran ruff format against the code or your code will fail CI-CD checks.


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. 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 workspace. To join, use this invitation. Once you have entered the workspace, then you can join the #netmiko channel.


Sponsors 2025

Special thanks to organizations and people that have helped support Netmiko development. In particular, these organizations have made meaningful contributions that help Netmiko keep moving forward:

Slurp'it Logo Netpicker Logo



Kirk Byers
Python for Network Engineers
https://pynet.twb-tech.com