Skip to main content
.. 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.


Metadata

Release files for sh 1.12.14

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

Source distribution (sdist)

Source distribution for sh 1.12.14
File Size Uploaded Provenance Actions
sh-1.12.14.tar.gz 56.9 kB Without provenance Details for sh-1.12.14.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sh 1.12.14
File Interpreter ABI Platform Actions
sh-1.12.14-py2.py3-none-any.whl Python 3, Python 2 none any Details for sh-1.12.14-py2.py3-none-any.whl

Total release size: 95.7 kB

Release files / sh-1.12.14.tar.gz

Download URL sh-1.12.14.tar.gz
Size 56.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b52bf5833ed01c7b5c5fb73a7f71b3d98d48e9b9b8764236237bdc7ecae850fc
BLAKE2b-256 checksum
How to use checksums
7c71199d27d3e7e78bf448bcecae0105a1d5b29173ffd2bbadaa95a74c156770
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / sh-1.12.14-py2.py3-none-any.whl

Download URL sh-1.12.14-py2.py3-none-any.whl
Size 38.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ae3258c5249493cebe73cb4e18253a41ed69262484bad36fdb3efcb8ad8870bb
BLAKE2b-256 checksum
How to use checksums
4a2217b22ef5b049f12080f5815c41bf94de3c229217609e469001a8f80c1b3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for sh 1.12.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.12.14 This release

2 release files No provenance

0.01

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