Skip to main content

Python subprocess replacement

Project description

Logo

Version Python Versions Build Status 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:

from sh import ifconfig
print ifconfig("eth0")

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

Docs

Installation

$> pip install sh

Updating the docs

Check out the 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.

Download files

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

Source Distribution

sh-1.12.13.tar.gz (56.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sh-1.12.13-py2.py3-none-any.whl (38.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file sh-1.12.13.tar.gz.

File metadata

  • Download URL: sh-1.12.13.tar.gz
  • Upload date:
  • Size: 56.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sh-1.12.13.tar.gz
Algorithm Hash digest
SHA256 979928ca113cade663bb1a0ff710e3eb9147596cf28a7ee4c04f9d85804f7b9f
MD5 52e2b13f6b3eea2c6f68428a76537c2d
BLAKE2b-256 d89739aa189a8392522cc24f14f392955cbeac48e2818d776241c37eb6d0eb3c

See more details on using hashes here.

File details

Details for the file sh-1.12.13-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for sh-1.12.13-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9ac63ced9c699a4328c1fc2fd0b94a88f0f5d0e69047d09063014e8dbbc1fdfc
MD5 f1244e308816ff187e0a23ae2578c637
BLAKE2b-256 27ef0a3023b1fca37d84832f526853bfb59fefeac13a6ca7b536da34315ea403

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