Skip to main content

Python subprocess replacement

Project description

Version Python Versions Build Status Coverage Status

sh is a full-fledged subprocess replacement for Python 2.6 - 3.5, 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.

Installation

$> pip install sh

Complete documentation @ http://amoffat.github.com/sh

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.1.tar.gz (52.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.1-py2.py3-none-any.whl (36.0 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for sh-1.12.1.tar.gz
Algorithm Hash digest
SHA256 19805071c75fb492c7a52982a3af094e95735d94752a9c6302452321ac88c0ef
MD5 33b3d5706d160c8d4febea0816baf7ed
BLAKE2b-256 091952cad6355af2949ae028ea44c1f2655fba369fcc0242646535a29285bf9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sh-1.12.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9f6120e92aaf57d6dddd717196b8400e2d63fb397ef5cb96ef345d7388dee50f
MD5 07edde31f8b9996f905f1ed8f39ce6f7
BLAKE2b-256 a26ab4a8cd58a49b752acf757a30a7ce072c9f9a00579b9943d264ff459e1a90

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