Skip to main content

High-speed concurrent SSH command runner

Project description

NetPulse SSH

High-performance, standalone Python library & CLI for concurrent SSH command execution across network devices.

PyPI version Python Versions License: MIT Code style: black


netpulse-ssh is an ultra-fast, resilient SSH execution engine extracted from the NetPulse discovery suite. It allows network engineers and automation pipelines to execute commands across hundreds of network devices simultaneously, without blocking I/O or crashing due to a single offline host.

✨ Features

  • Massive Concurrency: Scales horizontally using asyncio to execute commands across hundreds of targets simultaneously.
  • Legacy Equipment Healing: Automatically detects strict OpenSSH cipher drops and seamlessly falls back to legacy algorithms (e.g., diffie-hellman-group1-sha1, 3des-cbc) which are frequently required for older Cisco or Juniper gear.
  • Smart Privilege Escalation: Natively supports Cisco enable mode privilege escalation without breaking automation.
  • Pagination Suppression: Automatically injects terminal length 0 before command execution to bypass interactive --More-- prompts.
  • REST API Enabled: Run the built-in FastAPI uvicorn wrapper to serve concurrent execution logic dynamically to web dashboards or automation scripts.

🚀 Quickstart

Installation

Install globally or locally via pip:

pip install netpulse-ssh

CLI Usage

Execute a command across multiple devices concurrently and get a beautiful, structured table summary:

netpulse-ssh execute 192.168.1.5 10.0.0.1 -c "show ip interface brief" -u admin -p password

Python API Integration

Use our cleanly typed Pydantic models and logic natively inside your own tools. The runner is completely agnostic and returns an audit object containing stdout/stderr per host:

import asyncio
from netpulse.ssh.models import SshHostConfig
from netpulse.ssh.runner import SshRunnerService

async def main():
    hosts = [
        SshHostConfig(ip="192.168.1.1", username="admin", password="password"),
        SshHostConfig(ip="10.0.0.1", username="admin", password="password"),
    ]
    
    runner = SshRunnerService()
    audit = await runner.execute_concurrently(hosts, "show version")
    
    for result in audit.results:
        print(f"Host {result.ip} status: {result.status}")
        print(result.stdout)

if __name__ == "__main__":
    asyncio.run(main())

📖 Documentation

Detailed documentation is available in the docs/ directory:

  • 🗺️ Usage Guide - Deep dive into CLI and REST API examples.
  • 🏗️ Architecture - Understand the asynchronous execution engine and legacy fallbacks.
  • 🧠 Design Decisions - Read about the decoupled persistence approach.
  • 🧪 Contributing - The development onboarding guide.

🤝 Contributing

We welcome contributions from the community! netpulse-ssh is open-source and maintained actively. Please read our Contributing Guidelines to understand how to clone the repository and submit your Pull Requests.

📜 License

Distributed under the MIT License. See LICENSE for more information.

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

netpulse_ssh-0.1.0.tar.gz (277.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netpulse_ssh-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file netpulse_ssh-0.1.0.tar.gz.

File metadata

  • Download URL: netpulse_ssh-0.1.0.tar.gz
  • Upload date:
  • Size: 277.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for netpulse_ssh-0.1.0.tar.gz
Algorithm Hash digest
SHA256 17cf8f6ba035b583d7b1833f0a9966b16e8c00babbbddb9c2691bf30aca0e411
MD5 d053fd2b6c8ab17acedaeb87ccf72bbf
BLAKE2b-256 65a5a70ed165bb9a048032a04016e792f6f63a089981f8ff87b902351eb97381

See more details on using hashes here.

File details

Details for the file netpulse_ssh-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: netpulse_ssh-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for netpulse_ssh-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 276fef4fd5a23678455aa36433ee75f094e45c08bba262d6c2fc179959d1ae89
MD5 d28ff40c57117913df4400d0c22b5644
BLAKE2b-256 4c8015afd70585085e55943601372004fbc2340aad868c472a82cbcadb4de3e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page