SSH Wrapper
ssh-wrapper owns one native OpenSSH ControlMaster and exposes only
no-fallback mux channels. It can also supervise one remote process group with
a bounded heartbeat lease, so owner loss cleans up only that group.
The runtime is fully typed and uses only the Python standard library. It does not choose hosts, store credentials, reconnect a lost master, or define a consumer protocol.
Requirements
- CPython 3.13 or 3.14
- Linux
- an OpenSSH client
python3on the remote host only when usingOwnedRemoteProcess
Installation
Install an exact reviewed version with pip:
python3.13 -m pip install "ssh-wrapper==0.1.1"
Use python3.14 in the same command when that is the selected supported
interpreter.
This is a library and does not install a command-line entry point, so pipx
is not an appropriate installation method.
Basic use
import asyncio
from pathlib import Path
from ssh_wrapper import ConnectionSpec, OpenSSHMaster, SSHMasterSettings
async def run() -> bytes:
master = OpenSSHMaster(
SSHMasterSettings(
ssh_path=Path("/usr/bin/ssh"),
false_path=Path("/usr/bin/false"),
connect_timeout=30,
),
ConnectionSpec.from_alias("workstation"),
)
await master.start()
try:
process = await asyncio.create_subprocess_exec(
*master.command_argv("uname -a"),
stdout=asyncio.subprocess.PIPE,
)
stdout, _stderr = await process.communicate()
if process.returncode:
raise RuntimeError(f"remote command exited {process.returncode}")
return stdout
finally:
await master.close()
The caller owns each ordinary secondary process and its output. Use
OwnedRemoteProcess for a long-lived child that must remain tied to an owner
lease.
Project links
Metadata
Release files for ssh-wrapper 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ssh_wrapper-0.1.1.tar.gz | 17.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ssh_wrapper-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.9 kB
Release files / ssh_wrapper-0.1.1.tar.gz
| Download URL | ssh_wrapper-0.1.1.tar.gz |
|---|---|
| Size | 17.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3791f61e202e86f045d9f5494053b6a948c1fb3eeb520c438be9d114179f22df
|
|
BLAKE2b-256 checksum How to use checksums |
f7959ba9d284def8d49abae51b86c73d78d86c7fc717690e968b7424d36105cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logRelease files / ssh_wrapper-0.1.1-py3-none-any.whl
| Download URL | ssh_wrapper-0.1.1-py3-none-any.whl |
|---|---|
| Size | 19.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
93874d7c0cf7fed017d0614d622fdbea71f6c3d30594b3ce332b74b3aaa0f2ff
|
|
BLAKE2b-256 checksum How to use checksums |
2c49e9c5a1a760db54e6964b1d088b7083def19f1f39817af5cf726b8bdb3866
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency log