Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Python subprocess replacement

Project description

.. image:: https://raw.githubusercontent.com/amoffat/sh/master/logo-230.png
:target: https://amoffat.github.com/sh
:alt: Logo

|

.. image:: https://img.shields.io/pypi/v/sh.svg?style=flat-square
:target: https://pypi.python.org/pypi/sh
:alt: Version
.. image:: https://img.shields.io/pypi/pyversions/sh.svg?style=flat-square
:target: https://pypi.python.org/pypi/sh
:alt: Python Versions
.. image:: https://img.shields.io/travis/amoffat/sh/master.svg?style=flat-square
:target: https://travis-ci.org/amoffat/sh
:alt: Build Status
.. image:: https://img.shields.io/coveralls/amoffat/sh.svg?style=flat-square
:target: https://coveralls.io/r/amoffat/sh?branch=master
:alt: Coverage Status

|

sh is a full-fledged subprocess replacement for Python 2.6 - 3.6, PyPy and PyPy3
that allows you to call any program as if it were a function:

.. code:: python

from sh import ifconfig
print ifconfig("eth0")

sh is *not* a collection of system commands implemented in Python.

`Complete documentation here<https://amoffat.github.com/sh>`_

Installation
============

::

$> pip install sh

Updating the docs
=================

Check out the `gh-pages <https://github.com/amoffat/sh/tree/gh-pages>`_ branch and follow the ``README.rst`` there.

Developers
==========

Testing
-------

First install the development requirements::

$> pip install -r requirements-dev.txt

The run the tests for all Python versions on your system::

$> python sh.py test

To run a single test for all environments::

$> python sh.py test FunctionalTests.test_unicode_arg

To run a single test for a single environment::

$> python sh.py test -e 3.4 FunctionalTests.test_unicode_arg

Coverage
--------

First run all of the tests::

$> python sh.py test

This will aggregate a ``.coverage``. You may then visualize the report with::

$> coverage report

Or generate visual html files with::

$> coverage html

Which will create ``./htmlcov/index.html`` that you may open in a web browser.


Release history Release notifications

This version
History Node

1.12.14

History Node

1.12.13

History Node

1.12.12

History Node

1.12.11

History Node

1.12.10

History Node

1.12.9

History Node

1.12.8

History Node

1.12.7

History Node

1.12.6

History Node

1.12.5

History Node

1.12.4

History Node

1.12.3

History Node

1.12.2

History Node

1.12.1

History Node

1.12.0

History Node

1.11

History Node

1.10

History Node

1.09

History Node

1.08

History Node

1.07

History Node

1.06

History Node

1.05

History Node

1.04

History Node

1.03

History Node

1.02

History Node

1.01

History Node

1.0

History Node

0.108

History Node

0.107

History Node

0.106

History Node

0.01

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
sh-1.12.14-py2.py3-none-any.whl (38.9 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Jun 7, 2017
sh-1.12.14.tar.gz (56.9 kB) Copy SHA256 hash SHA256 Source None Jun 7, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page