Registry / devops / spindlex

spindlex

JSON →
library0.7.2pypypi✓ verified 89d ago

A modern, high-performance SSHv2 and SFTP client/server library for Python, supporting async operations, secure key exchange, and file transfers. Current version is 0.7.2, requiring Python 3.9+. Releases are on a monthly cadence.

pip install spindlex
INSTALL
IMPORT
SIG · SPINDLEX
S
spindlex
devopspythonv0.7.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SSHClient
✓ from spindlex import SSHClient
✗ from spindlex.client import SSHClient
The public API is at the package root; using submodules may break in future versions.
SFTPClient
✓ from spindlex import SFTPClient

Basic SSH and SFTP operations using environment variables for credentials.

import os from spindlex import SSHClient, SFTPClient host = os.environ.get('SSH_HOST', 'localhost') port = int(os.environ.get('SSH_PORT', 22)) username = os.environ.get('SSH_USER', 'user') password = os.environ.get('SSH_PASS', '') client = SSHClient(host, port=port) client.connect(username, password) # Execute a command stdout, stderr, exit_code = client.run('ls -la') print('STDOUT:', stdout) # File transfer sftp = client.sftp() sftp.put('local.txt', '/remote/path/remote.txt') sftp.get('/remote/path/remote.txt', 'downloaded.txt') client.close()
Debug
Known issues
gotchaThe default timeout is None (infinite). Always set a timeout to avoid hanging indefinitely.
fix
Pass timeout parameter: SSHClient(host, timeout=30)
affects: >=0.1
breakingIn version 0.7.0, the SSHClient constructor changed from positional to keyword arguments for host and port. Using positional arguments still works in 0.7.2 but may break in a future release.
fix
Use SSHClient(host='hostname', port=22) instead of SSHClient('hostname', 22).
affects: 0.7.0 - 0.7.2
deprecatedThe SFTPClient class was moved from spindlex.sftp to spindlex in 0.6.0. Importing from spindlex.sftp still works but is deprecated.
fix
Use from spindlex import SFTPClient.
affects: 0.6.0 - 0.7.2
Errors
Common errors & fixes
spindlex.SSHClient` object has no attribute 'sftp'
Using an older version (<0.6.0) where SFTP was not integrated into SSHClient.
fix
Upgrade spindlex to >=0.6.0: pip install --upgrade spindlex
ImportError: cannot import name 'SSHClient' from 'spindlex'
Installed version is <0.5.0 where the main classes were in a different location.
fix
Upgrade to 0.7.2: pip install --upgrade spindlex
TimeoutError: Connection timed out
SSH server not reachable or firewall blocking port 22. Also, default timeout is None (infinite) leading to indefinite hang.
fix
Ensure server is accessible and set timeout: SSHClient(host, timeout=10)
Upgrade
Version history
0.7.2latest on PyPI · released May 30, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
37 hits · last 30 days
node
34
OpenAI (training)
1
Resources
spindlex — pip install spindlex · libregistry