Skip to main content

Async remote file ops over SSH (scp) with robust defaults and Python bindings

Project description

async_server_ops 1.0.0 (scp-only, robust)

  • Remote operations via OpenSSH scp (no rsync dependency)
  • Non-interactive defaults (BatchMode, ConnectTimeout, keepalives) to prevent hangs
  • Correct flags: ssh -p, scp -P
  • Optional password via sshpass -e (set password), but keys are recommended
  • Builds abi3 wheel for Python 3.8+

Build for Python (wheel/dev)

pip install -U maturin
maturin develop -F python --release
# or build wheel: maturin build -F python --release

Python usage

import asyncio
from async_server_ops import ServerManagerPy as ServerManager, PyRemoteConfig as RemoteConfig

async def main():
    cfg = RemoteConfig(
        host="192.168.222.61",
        user="administrator",
        key_path="~/.ssh/id_ed25519",
        port=22,
        prefer_rsync=False,             # scp-only build; flag kept for API compatibility
        ssh_extra_args=[
            "-o","IdentitiesOnly=yes",
            "-o","BatchMode=yes",
            "-o","ConnectTimeout=8",
            "-o","ServerAliveInterval=5","-o","ServerAliveCountMax=2",
        ],
        # password=None,                # optional: requires sshpass installed on client
    )
    m = ServerManager.remote(cfg)

    print("preflight:", await m.preflight())

    rem = "/home/administrator/FoodIpadStorage/temp/dksl_c4db8429.pdf"
    await m.download_file(rem, "file.pdf")
    await m.create_dir_all("/tmp/ops_demo")
    await m.upload_file("file.pdf", "/tmp/ops_demo/file.pdf")
    print("done")

asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

async_server_ops-1.0.4-cp38-abi3-win_amd64.whl (63.4 kB view details)

Uploaded CPython 3.8+Windows x86-64

File details

Details for the file async_server_ops-1.0.4-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for async_server_ops-1.0.4-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ac95ce2eafe0a47f67198e098e7f323d4ad32e90dca5d960618094f9adf12a40
MD5 3da580af6cd1c21e617ec09bc1d6f675
BLAKE2b-256 f01d653c71734d968bb8bf7a84768fea0396a85c208fa34de12471dbd67b8c1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page