Skip to main content

A standard library emulation layer over SSH

Project description

sshstdlib [![Build Status](https://travis-ci.org/stestagg/sshstdlib.png)](https://travis-ci.org/stestagg/sshstdlib)
=========

sshstdlib emulates the python standard libraries, operating over an SSH tunnel.

It uses paramiko to set up an SSH session, and allows simple remote execution
and familiar methods on the remote system.

Goals
=====

The ideal of sshstdlib is to provide a sensible, pragmatic subset of the python standard libraries.
Largely, this is done by dynamically pushing and running a small python client to the box. :module:`sshstdlib.remote_client`.
Some functionality uses the SSH sftp functionality, and some involves running commands directly using the ssh 'exec' channels.

If functionality is missing from sshstdlib that is present in the python standard libraries, this is a 'missing feature'
let us know if you need anything specific, or feel free to contribute implementations.

If sshstdlib behaviour differs in a meaningful way from the equivalent standard library functionality, this is a bug.
Please submit it as such.

Sometimes adding extra functionality makes sense. This should be done in an unobtrusive manner, and be documented explicitly here.

Example usage
=============

```python
In [1]: import sshstdlib.client

In [2]: remote = sshstdlib.client.Client.connect("localhost", username="jenkins", password="XXXXXX", no_keys=True)

In [3]: with remote.tempfile.NamedTemporaryFile() as fh:
...: fh.write("hello world")
...: print fh.name
...:
/tmp/tmpRthB9D

In [4]: remote.os.path.exists("/tmp/tmpRthB9D")
Out[4]: False

```

Documentation
=============

API Documentation can be found here: https://sshstdlib.readthedocs.org/en/latest/index.html

Notes
=====

Channels are set up only when required, so the python client is only pushed and run when the first call that requires is is made. likewise with the sftp channel. both the :attr:`python` and :attr:`sftp` channels are persisted once created for the lifetime of the client.

Project details


Download files

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

Source Distribution

sshstdlib-1.4.tar.gz (13.5 kB view details)

Uploaded Source

File details

Details for the file sshstdlib-1.4.tar.gz.

File metadata

  • Download URL: sshstdlib-1.4.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sshstdlib-1.4.tar.gz
Algorithm Hash digest
SHA256 22fa31b6bc0576c1dca1dec570302bdfbeb43547215ddd044def3d74190ca5cb
MD5 d249f5fd68c1992ffbbda6a3204c2fcb
BLAKE2b-256 8f84537ab90df55f794e8a62b6a94d3afc727729e691fbb9843f42d5924a37c6

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