Skip to main content

nw-ssh

Simple ssh client with asyncssh for network devices.

import asyncio
import nw_ssh

async def main() -> None:
    async with nw_ssh.SSHConnection(
        host='169.254.0.1',
        port=22,
        username='root',
        password='password',
        client_keys=[],
        passphrase=None,
        known_hosts_file=None,
        delimiter=r'#',
        timeout=10,
    ) as conn:

        print(conn.login_message)

        output = await conn.send(input='cli', delimiter=r'>')
        print(output)

        output = await conn.send(input='show interfaces fxp0 | no-more', delimiter=r'>')
        print(output)

        output = await conn.send(input='configure', delimiter=r'#')
        print(output)

        output = await conn.send(input='show interfaces', delimiter=r'#')
        print(output)

        output = await conn.send(input='commit', delimiter=r'#', timeout=10)
        print(output)

asyncio.run(main())

Requirements

  • Python >= 3.7
  • asyncssh

Installation

pip install nw-ssh

License

MIT

Metadata

Release files for nw-ssh 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nw-ssh 1.0.4
File Size Uploaded
nw-ssh-1.0.4.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nw-ssh 1.0.4
File Interpreter ABI Platform
nw_ssh-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / nw-ssh-1.0.4.tar.gz

Download URL nw-ssh-1.0.4.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d6d4ea422c753fe45fcb3c26d6efbdaf4cc1f57fb0015ad575cbc82d0ac48596
BLAKE2b-256 checksum
How to use checksums
e747806ba57039668749eeb74255b72e2d2c16bae963d97d756b897f587e89c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.10 Windows/10

Release files / nw_ssh-1.0.4-py3-none-any.whl

Download URL nw_ssh-1.0.4-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7215d01d88a313bc0359b7b02c8060728b460574fccc571498d3eae18531aa5
BLAKE2b-256 checksum
How to use checksums
601b4c26647ff25286cfd65b17358658b404f4295f0256f48baaf7caf270207e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.10 Windows/10

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page