spur
Run commands and manipulate files locally or over SSH using the same interface
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 spuruv
uv add spurpoetry
poetry add spurInstalling 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
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
paramiko-expectParamiko Expect adds expect-like pattern…
permissive · top 15,000 on PyPI
pyinfrapyinfra executes Python code as infrastructure…
permissive · top 15,000 on PyPI
scripttestscripttest runs command-line applications in…
permissive · top 15,000 on PyPI
fabricFabric executes shell commands remotely over…
permissive · top 5,000 on PyPI
EasyProcessEasyProcess wraps Python's subprocess module to…
permissive · top 5,000 on PyPI
fabric2Fabric executes shell commands remotely over…
permissive · top 15,000 on PyPI
bashProvides a Python wrapper for running bash…
copyleft · top 15,000 on PyPI
fs.sshfsfs.sshfs provides a PyFilesystem2 interface to…
copyleft · top 15,000 on PyPI
subprocrunnerWraps Python's subprocess module to simplify…
permissive · top 15,000 on PyPI
jumpsshJumpSSH runs commands on remote servers through…
permissive · top 15,000 on PyPI