skillfed

spur

Run commands and manipulate files locally or over SSH using the same interface

spur v0.3.23 98.4K downloads/30d#13,083 on PyPI272
Permissive license BSD-2-Clause Abandoned released

What it is and what it does

Spur is a Python library that abstracts local shell execution and remote SSH command execution behind a single, consistent interface. You create either a LocalShell or SshShell object, then call the same methods (run, spawn, open) on either one to execute commands or manipulate files. The run method executes a command synchronously and returns an ExecutionResult with output and return code; spawn returns a process object for asynchronous control. File operations use a context-manager pattern similar to Python's built-in open.

The library handles SSH authentication via password or private key, supports custom ports and timeouts, and allows passing socket-like objects for proxy scenarios. It depends on paramiko for SSH transport. The package targets developers who need to write scripts that work identically whether running locally or remotely, avoiding code duplication and conditional branching around shell execution.

Use it for:

  • Write deployment or configuration management scripts that run the same commands on local and remote machines without conditional logic.
  • Copy files between local and remote systems over SSH using a file-like interface similar to Python's open().
  • Spawn long-running processes on remote servers and poll their status or interact with their stdin/stdout asynchronously.
  • Execute commands in a specific working directory or with custom environment variables on either local or remote shells.
  • Automate system administration tasks that need to work across heterogeneous environments (local, Linux servers, embedded systems with minimal shells).

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a unified Python interface to run shell commands and manipulate files either locally or over SSH, using the same API for both contexts.

Yes, if you need a simple unified interface for local and SSH command execution and can accept the maintenance risk. The package is abandoned (last release 2023-03-11, no commits since), so it will not receive security updates or compatibility fixes for future Python or paramiko versions. It remains functional for stable, non-security-critical automation tasks, but consider maintained alternatives for production systems or security-sensitive deployments.

Install

spur on PyPI

pip

pip install spur

uv

uv add spur

poetry

poetry add spur

Installing spur

Before you install

Low install friction with a pure-Python wheel. However, the package is abandoned as of 2023-03-11 with no recent maintenance, so security updates and compatibility fixes are unlikely to arrive.

License in practice

BSD-2-Clause is permissive and poses no significant licensing constraints for most use cases.

Quickstart

import spur

# Local execution
shell = spur.LocalShell()
result = shell.run(["echo", "-n", "hello"])
print(result.output)

# SSH execution
shell = spur.SshShell(hostname="localhost", username="bob", password="password1")
with shell:
    result = shell.run(["echo", "-n", "hello"])
    print(result.output)

Requires paramiko as a runtime dependency for SSH functionality; SSH authentication requires valid credentials or private key access to the target host.

Verify before relying

  • Whether the package remains compatible with current versions of paramiko and modern SSH server configurations.
  • Whether the minimal shell type (spur.ssh.ShellTypes.minimal) works reliably on embedded systems it targets.
  • Current state of the GitHub repository and whether community forks or maintained alternatives have superseded this package.

Package facts

License BSD-2-Clause (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 1 — paramiko
Maintenance abandoned — 1,252 days since the last release
Last repo commit
First released
Downloads 98,444/month — #13,083 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: spur-0.3.23-py2.py3-none-any.whl

Keywords: ssh, shell, subprocess, process

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Internet

Tags

ssh command execution pythonrun commands over sshlocal and remote shell interfacepython subprocess ssh wrapperfile manipulation sshremote command executionunified shell interface
ssh-automationshell-abstractionremote-execution

More Internet packages