Skip to main content
Logo

If you are migrating from 1.* to 2.*, please see MIGRATION.md


Version Downloads Status Python Versions Build Status Coverage Status

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

sh relies on various Unix system calls and only works on Unix-like operating systems - Linux, macOS, BSDs etc. Specifically, Windows is not supported.

Complete documentation here

Installation

$> pip install sh

Support

Developers

Updating the docs

Check out the gh-pages branch and follow the README.rst there.

Testing

Tests are run in a docker container against all supported Python versions. To run, make the following target:

$> make test

To run a single test:

$> make test='FunctionalTests.test_background' test_one

Coverage

First run all of the tests:

$> SH_TESTS_RUNNING=1 coverage run --source=sh -m unittest

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-2.0.3.tar.gz (345.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-2.0.3-py3-none-any.whl (38.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sh-2.0.3.tar.gz
  • Upload date:
  • Size: 345.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for sh-2.0.3.tar.gz
Algorithm Hash digest
SHA256 800efeda403b63879b0a5625f65a0021fd1ea61ed181954da0346372a7b2a341
MD5 8d1040967809e22c615cf69dec0ec993
BLAKE2b-256 b79618aa20a143e2eaf1f0b4ae41a5ec57fd45b76b4a76cc4a07ffb476161ae3

See more details on using hashes here.

File details

Details for the file sh-2.0.3-py3-none-any.whl.

File metadata

  • Download URL: sh-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 38.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for sh-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 351f8968a2ed99755665fef62f038d60b5245999d73c2f1b1705f48b22e2a853
MD5 01764fdebe89721b6e14371b71af0834
BLAKE2b-256 06dd13b1cd87bfcd54e664304718535b33ce93a6ef2ebddb00f8ed0b743d90b9

See more details on using hashes here.

Release history Release notifications | RSS feed

2.4.0

2 files

2.3.0

2 files

2.2.6

2 files

2.2.5

2 files

2.2.4

2 files

2.2.3

2 files

2.2.2

2 files

2.2.1

2 files

2.2.0

2 files

2.1.0

2 files

2.0.7

2 files

2.0.6

2 files

2.0.5

2 files

2.0.4

2 files

This release

2.0.3 This release

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

1.14.3

1 file

1.14.2

2 files

1.14.1

2 files

1.14.0

2 files

1.13.1

2 files

1.13.0

2 files

1.12.14

2 files

1.12.13

2 files

1.12.12

2 files

1.12.11

2 files

1.12.10

2 files

1.12.9

2 files

1.12.8

2 files

1.12.7

2 files

1.12.6

2 files

1.12.5

2 files

1.12.4

2 files

1.12.3

2 files

1.12.2

2 files

1.12.1

2 files

1.12.0

2 files

1.11

1 file

1.10

1 file

1.09

1 file

1.08

1 file

1.07

1 file

1.06

1 file

1.05

1 file

1.04

1 file

1.03

1 file

1.02

1 file

1.01

1 file

1.0

1 file

0.108

1 file

0.107

1 file

0.106

1 file

0.01

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page