If you are migrating from 1.* to 2.*, please see MIGRATION.md
sh is a full-fledged subprocess replacement for Python 3.8 - 3.11, and PyPy 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.
Installation
$> pip install sh
Support
Andrew Moffat - author/maintainer
Erik Cederstrand - maintainer
Developers
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 pytest
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 files for sh 2.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sh-2.0.6.tar.gz | 345.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sh-2.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 383.6 kB
Release files / sh-2.0.6.tar.gz
| Download URL | sh-2.0.6.tar.gz |
|---|---|
| Size | 345.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b2998f313f201c777e2c0061f0b1367497097ef13388595be147e2a00bf7ba1
|
|
BLAKE2b-256 checksum How to use checksums |
cd517355831d8e1cee8348157d769ccda8a31ca9fa0548e7f93d87837d83866d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / sh-2.0.6-py3-none-any.whl
| Download URL | sh-2.0.6-py3-none-any.whl |
|---|---|
| Size | 38.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ced8f2e081a858b66a46ace3703dec243779abbd5a1887ba7e3c34f34da70cd2
|
|
BLAKE2b-256 checksum How to use checksums |
53089de3e477ad2fd432e78ce351341686d1bbec346976b22c7cc5f81f1ff15a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|