<commit_before>============
parallel-ssh
============

Asynchronous parallel SSH client library.

Run SSH commands over many - hundreds/hundreds of thousands - number of servers asynchronously and with minimal system load on the client host.

Native code based clients with extremely high performance, making use of C libraries.

.. image:: https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg
  :target: https://pypi.python.org/pypi/parallel-ssh
  :alt: License
.. image:: https://img.shields.io/pypi/v/parallel-ssh.svg
  :target: https://pypi.python.org/pypi/parallel-ssh
  :alt: Latest Version
.. image:: https://circleci.com/gh/ParallelSSH/parallel-ssh/tree/master.svg?style=svg
  :target: https://circleci.com/gh/ParallelSSH/parallel-ssh
.. image:: https://codecov.io/gh/ParallelSSH/parallel-ssh/branch/master/graph/badge.svg
  :target: https://codecov.io/gh/ParallelSSH/parallel-ssh
.. image:: https://img.shields.io/pypi/wheel/parallel-ssh.svg
  :target: https://pypi.python.org/pypi/parallel-ssh
.. image:: https://readthedocs.org/projects/parallel-ssh/badge/?version=latest
  :target: https://parallel-ssh.readthedocs.org/en/latest/
  :alt: Latest documentation

.. _`read the docs`: https://parallel-ssh.readthedocs.org/en/latest/

************
Installation
************

.. code-block:: shell

   pip install parallel-ssh


An update to `pip` may be needed to be able to install binary wheels.

.. code-block:: shell

   pip install -U pip
   pip install parallel-ssh


*************
Usage Example
*************

See documentation on `read the docs`_ for more complete examples.

Run ``uname`` on two hosts in parallel.

.. code-block:: python

  from pssh.clients import ParallelSSHClient

  hosts = ['localhost', 'localhost']
  client = ParallelSSHClient(hosts)

  output = client.run_command('uname')
  for host_output in output:
      for line in host_output.stdout:
          print(line)
      exit_code = host_out.exit_code

:Output:
<commit_msg>Parallel host snippet output typo (#282)<commit_after>============
parallel-ssh
============

Asynchronous parallel SSH client library.

Run SSH commands over many - hundreds/hundreds of thousands - number of servers asynchronously and with minimal system load on the client host.

Native code based clients with extremely high performance, making use of C libraries.

.. image:: https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg
  :target: https://pypi.python.org/pypi/parallel-ssh
  :alt: License
.. image:: https://img.shields.io/pypi/v/parallel-ssh.svg
  :target: https://pypi.python.org/pypi/parallel-ssh
  :alt: Latest Version
.. image:: https://circleci.com/gh/ParallelSSH/parallel-ssh/tree/master.svg?style=svg
  :target: https://circleci.com/gh/ParallelSSH/parallel-ssh
.. image:: https://codecov.io/gh/ParallelSSH/parallel-ssh/branch/master/graph/badge.svg
  :target: https://codecov.io/gh/ParallelSSH/parallel-ssh
.. image:: https://img.shields.io/pypi/wheel/parallel-ssh.svg
  :target: https://pypi.python.org/pypi/parallel-ssh
.. image:: https://readthedocs.org/projects/parallel-ssh/badge/?version=latest
  :target: https://parallel-ssh.readthedocs.org/en/latest/
  :alt: Latest documentation

.. _`read the docs`: https://parallel-ssh.readthedocs.org/en/latest/

************
Installation
************

.. code-block:: shell

   pip install parallel-ssh


An update to `pip` may be needed to be able to install binary wheels.

.. code-block:: shell

   pip install -U pip
   pip install parallel-ssh


*************
Usage Example
*************

See documentation on `read the docs`_ for more complete examples.

Run ``uname`` on two hosts in parallel.

.. code-block:: python

  from pssh.clients import ParallelSSHClient

  hosts = ['localhost', 'localhost']
  client = ParallelSSHClient(hosts)

  output = client.run_command('uname')
  for host_output in output:
      for line in host_output.stdout:
          print(line)
      exit_code = host_output.exit_code

:Output:

{'fraction_non_alphanumeric': 0.15960665658093798, 'fraction_numerical': 0.002773575390821987, 'mean_word_length': 3.9218362282878414, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 26, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3156370', 'n_tokens_mistral': 1331, 'n_tokens_neox': 1244, 'n_words': 305}