A modern, high-performance SSHv2 and SFTP client/server library
Project description
⚡ Overview
SpindleX is a modern SSH protocol implementation for Python 3.9+. It is designed for high-performance automation and secure file transfers, providing a clean alternative to legacy SSH libraries.
[!NOTE] 0.7.x - ChaCha20-Poly1305 & SFTP throughput era. This release line adds full
chacha20-poly1305@openssh.comsupport as the preferred cipher, adaptive SFTP write chunks vialimits@openssh.com(up to 255 KB), and a hardened async transport. Review SECURITY.md, production usage expectations, and compatibility policy before deploying in production-facing workflows.
🔥 Key Features
- 🚀 High Performance: Adaptive SFTP write chunks up to 255 KB via
limits@openssh.comnegotiation, pipelined transfers, and zero-copy internal buffering. - 🔒 ChaCha20-Poly1305: Preferred AEAD cipher - no separate MAC pass, full Terrapin-defense strict-KEX, on par with leading SSH libraries.
- 🔄 Native Async: First-class
asynciosupport viaAsyncSSHClientandAsyncSFTPClient. - 🛡️ Secure by Default: Modern primitives only - Ed25519, ECDSA, ChaCha20-Poly1305, AES-CTR. Legacy/weak ciphers are not negotiated.
- 🔗 Advanced Tunneling: Support for ProxyJump (bastion hosts) and TCP port forwarding.
- 📂 Recursive SFTP: Native support for recursive directory uploads and downloads.
- 🏷️ Fully Typed: Comprehensive type hints for IDE integration and static analysis.
💎 Why SpindleX?
- 💼 Business Friendly: MIT Licensed. Permissive use for commercial and proprietary projects.
- 📖 Maintainable Code: Modular architecture designed for clarity and easier security auditing.
- 🛠️ Modern API: Clean, intuitive interface with consistent error handling and minimal dependencies.
- 🧊 Focused Scope: No support for insecure legacy protocols, resulting in a leaner and more secure codebase.
🛠️ Tech Stack
Core Logic
Protocol
Concurrency
🚀 Quick Start
Installation
# Using pip
pip install spindlex
# Using uv
uv pip install spindlex
💻 Usage Preview
Synchronous Example
from spindlex import SSHClient
with SSHClient() as client:
client.get_host_keys().load()
client.connect('example.com', username='admin')
stdin, stdout, stderr = client.exec_command('uptime')
print(f"Server Status: {stdout.read().decode().strip()}")
Asynchronous Example
import asyncio
from spindlex import AsyncSSHClient
async def main():
async with AsyncSSHClient() as client:
await client.connect('example.com', username='admin')
stdin, stdout, stderr = await client.exec_command('df -h')
print(await stdout.read())
asyncio.run(main())
📊 Performance Benchmarks
SpindleX is optimized for high-throughput environments. The 0.7.x line brings SFTP upload throughput in line with leading SSH libraries and adds ChaCha20-Poly1305 as the preferred cipher.
| Operation | SpindleX | Other libs | Notes |
|---|---|---|---|
| SFTP upload (1 MiB, chacha20) | ~14 ms | ~14 ms | On par after limits negotiation |
| SFTP upload (1 MiB, AES-CTR) | ~14 ms | ~14 ms | Pipelined, 255 KB chunks |
| Handshake | ~320 ms | ~320 ms | Ed25519 + Curve25519 |
[!TIP] Run the benchmark suite on your own hardware:
python scripts/benchmark_ciphers.py # cipher comparison python scripts/benchmark_production.py # full protocol correctness + perf
🛡️ Security
- Verification Enforced: Host key verification is mandatory by default.
- Log Sanitization: Credentials and sensitive data are automatically filtered from logs.
- AEAD Preferred:
chacha20-poly1305@openssh.comis the default cipher - authentication is integral, no separate MAC. - Terrapin Defense: Strict-KEX (
kex-strict-c-v00@openssh.com) enabled, sequence numbers reset after NEWKEYS. - Modern Defaults: Ed25519, ECDSA, ChaCha20-Poly1305, and AES-CTR only. SHA-1 and CBC mode are excluded.
- Full Policy: See SECURITY.md for vulnerability reporting and Security Guide for operational security guidance.
🤝 Contributing
Contributions are welcome. See CONTRIBUTING.md for the GitHub entry point and docs/contributing.md for the maintained guide.
Distributed under the MIT License. See LICENSE for more information.
SpindleX Project © 2026 Stratza Labs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file spindlex-0.7.1.tar.gz.
File metadata
- Download URL: spindlex-0.7.1.tar.gz
- Upload date:
- Size: 147.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03bf71211dd806095fbdb330005b89682ad6d8537e21b722f3b9a1e7ee56529b
|
|
| MD5 |
cde77f48e8ca37c8bb8f8802d01087a7
|
|
| BLAKE2b-256 |
dea15cb60d713f3f3937569c2f104c1d1d530af076b5f3cb2cbf0ce802f7fc4c
|
Provenance
The following attestation bundles were made for spindlex-0.7.1.tar.gz:
Publisher:
release.yml on stratza/spindlex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spindlex-0.7.1.tar.gz -
Subject digest:
03bf71211dd806095fbdb330005b89682ad6d8537e21b722f3b9a1e7ee56529b - Sigstore transparency entry: 1670453025
- Sigstore integration time:
-
Permalink:
stratza/spindlex@54434e5cc5a58d92c219ea74a5fbcf39344e4e19 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/stratza
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@54434e5cc5a58d92c219ea74a5fbcf39344e4e19 -
Trigger Event:
push
-
Statement type:
File details
Details for the file spindlex-0.7.1-py3-none-any.whl.
File metadata
- Download URL: spindlex-0.7.1-py3-none-any.whl
- Upload date:
- Size: 161.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ead1b8c7a92e7474c46b662965fd2b960e4bb8042cef519958e291857ced4133
|
|
| MD5 |
dad85a35537872b02976fea498bda566
|
|
| BLAKE2b-256 |
33111a0c0f896885a8b3d9a4c3cf607cd45ae535fbf152e44360804c15f97196
|
Provenance
The following attestation bundles were made for spindlex-0.7.1-py3-none-any.whl:
Publisher:
release.yml on stratza/spindlex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spindlex-0.7.1-py3-none-any.whl -
Subject digest:
ead1b8c7a92e7474c46b662965fd2b960e4bb8042cef519958e291857ced4133 - Sigstore transparency entry: 1670453098
- Sigstore integration time:
-
Permalink:
stratza/spindlex@54434e5cc5a58d92c219ea74a5fbcf39344e4e19 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/stratza
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@54434e5cc5a58d92c219ea74a5fbcf39344e4e19 -
Trigger Event:
push
-
Statement type: