A lightweight, ergonomic SSH library.
Project description
EZSSH
An Ergonomic and Lightweight SSH Library.
Installation
pip install ezssh
Quick Start
from ezssh import SSHRunner, Command, BatchPolicy
with SSHRunner(
host="10.0.0.5",
username="ubuntu",
password="secret", # password as null will attempt pubkey
) as runner:
result = runner.run("uname -a")
print(result.stdout)
batch = runner.run_batch(
[
"whoami",
Command("systemctl is-active ssh", sudo=True, name="ssh_status"),
],
policy=BatchPolicy(stop_on_failure=False),
)
for r in batch.results:
print(r.command.name, r.exit_status)
Batch Operations
batch processing of cli commands is also available. To execute a chain of prepared commands:
batch = runner.run_batch(
[
Command("mkdir -p /tmp/example"),
Command("touch /tmp/example/file.txt"),
Command("false", name="intentional_failure"),
Command("echo still runs"),
],
policy=BatchPolicy(stop_on_failure=False),
)
# Each returns an exit status, stdout/stderror, start/end and duration.
Authentication Behavior
Password auth uses password only, agent and key discovery are opt-in.
SSHRunner(
host="example.com",
username="user",
password="secret",
allow_agent=False,
look_for_keys=False,
)
When to Use ezssh
Use ezssh if you need:
- Programmatic SSH execution embedded in a Python application
- Deterministic batch execution with structured results
- Explicit authentication behavior
- Lightweight automation without orchestration frameworks
Do not use ezssh if you need:
- Configuration management
- Long-lived agents
- Inventory management
- Declarative state convergence
How ezssh Compares
| Tool | ezssh | Paramiko | Fabric | Ansible |
|---|---|---|---|---|
| Embedded in apps | ✅ | ⚠️ | ⚠️ | ❌ |
| Batch semantics | ✅ | ❌ | ⚠️ | ✅ |
| Explicit auth | ✅ | ❌ | ❌ | ⚠️ |
| Minimal deps | ✅ | ✅ | ❌ | ❌ |
| YAML required | ❌ | ❌ | ❌ | ✅ |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ezssh-0.0.8.tar.gz
(9.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
ezssh-0.0.8-py3-none-any.whl
(9.8 kB
view details)
File details
Details for the file ezssh-0.0.8.tar.gz.
File metadata
- Download URL: ezssh-0.0.8.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1540cb3158a0d6be7153a1b0d1689cb6143c511be012dbff95f29d59026ad0e
|
|
| MD5 |
05130c42d7d576a5ea34790ebea788a8
|
|
| BLAKE2b-256 |
b6943725066b320a75e5dbee7573754176ff1ef4e78678ceb43ec299f35621ea
|
File details
Details for the file ezssh-0.0.8-py3-none-any.whl.
File metadata
- Download URL: ezssh-0.0.8-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
376aac8187d8d779df648e9ebde4b9256904935ca4d219c820bbd0ad14933f06
|
|
| MD5 |
461563650f636c9f86d1a9deb25f6d47
|
|
| BLAKE2b-256 |
4f92d12e25dc370ca9c2de7f67b0b204be3e7d0aebb2a33741d5f5b5785b4c11
|