Metadata-Version: 2.4
Name: netapult-ssh
Version: 0.0.2
Summary: Plugin for Netapult to support command execution over SSH
Project-URL: Homepage, https://github.com/Jayson-Fong/netapult-ssh
Project-URL: Issues, https://github.com/Jayson-Fong/netapult-ssh/issues
Author-email: Jayson Fong <jayson.fong@gatech.edu>
License: MIT
License-File: LICENSE
Classifier: Development Status :: 1 - Planning
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: System :: Networking
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: netapult==0.0.2
Requires-Dist: paramiko>=4.0.0
Description-Content-Type: text/markdown

<!--suppress HtmlDeprecatedAttribute-->
<div align="center">
   <h1>🐚 Netapult: SSH Plugin</h1>
</div>

<hr />

<div align="center">

[💼 Purpose](#purpose) | [🏁 Usage](#usage)

</div>

<hr />

# Purpose

This plugin provides the SSH protocol for [Netapult](https://pypi.org/project/netapult/), enabling scalable network 
automation and orchestration for network-connected devices.

# Usage

This package registers a `ssh` protocol handler for Netapult, usable from Netapult's dispatcher.

```python
import time

import netapult

with netapult.dispatch(
    "generic", # Use the generic client
    "ssh", # Use our SSH protocol
    protocol_options={
        "host": "your-host-here",
        "username": "your-username-here",
        "password": "your-password-here",
    },
) as client:
    # Allow time for the terminal to initialize
    time.sleep(3)

    # Acquire the banner
    banner: str = client.read(text=True)
    prompt_found, result = client.run_command("echo Hello World\n", text=True)

    print("Banner:", banner)
    print("Result:", result)

```