Skip to main content
Logo

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


Version Downloads Status Python Versions Coverage Status

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.

Complete documentation here

Installation

$> pip install sh

Support

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.

Metadata

Release files for sh 2.0.5

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 2.0.5
File Size Uploaded Provenance Actions
sh-2.0.5.tar.gz 44.9 kB Without provenance Details for sh-2.0.5.tar.gz

Built distribution (wheel)

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

Total release size: 91.3 kB

Release files / sh-2.0.5.tar.gz

Download URL sh-2.0.5.tar.gz
Size 44.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9d9e59498da2871c51d6170a8815da83a72c2c2d29f335e7abf0202e1a8fdb7f
BLAKE2b-256 checksum
How to use checksums
3786ece11098f49068b8e77a46b83bce8e539b9416cfc03f2fab287f92d7230f
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.5-py3-none-any.whl

Download URL sh-2.0.5-py3-none-any.whl
Size 46.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a52f6e064919fdf198c7383ccdd570fe0acde74b92bc7149863c1fe652ab7e11
BLAKE2b-256 checksum
How to use checksums
70742e736bba864003888345b985e347d36de4f3b77757b5169281eaf38de2ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for sh 2.0.5

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

2.0.5 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