Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://amoffat.github.io/sh
Python process launching
https://amoffat.github.io/sh
devops python subprocess
Last synced: 10 days ago
JSON representation
Python process launching
- Host: GitHub
- URL: https://amoffat.github.io/sh
- Owner: amoffat
- License: mit
- Created: 2012-01-15T05:52:06.000Z (almost 13 years ago)
- Default Branch: develop
- Last Pushed: 2024-10-17T22:17:27.000Z (26 days ago)
- Last Synced: 2024-10-29T23:49:57.391Z (14 days ago)
- Topics: devops, python, subprocess
- Language: Python
- Homepage: https://sh.readthedocs.io/en/latest/
- Size: 2.02 MB
- Stars: 6,978
- Watchers: 135
- Forks: 506
- Open Issues: 5
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
- Codeowners: CODEOWNERS
Awesome Lists containing this project
- awesome - sh - Call any program as if it were a function. (Python / Libraries)
README
.. image:: https://raw.githubusercontent.com/amoffat/sh/master/images/logo-230.png
:target: https://amoffat.github.com/sh
:alt: Logo**If you are migrating from 1.* to 2.*, please see MIGRATION.md**
|
.. image:: https://img.shields.io/pypi/v/sh.svg?style=flat-square
:target: https://pypi.python.org/pypi/sh
:alt: Version
.. image:: https://img.shields.io/pypi/dm/sh.svg?style=flat-square
:target: https://pypi.python.org/pypi/sh
:alt: Downloads Status
.. image:: https://img.shields.io/pypi/pyversions/sh.svg?style=flat-square
:target: https://pypi.python.org/pypi/sh
:alt: Python Versions
.. image:: https://img.shields.io/coveralls/amoffat/sh.svg?style=flat-square
:target: https://coveralls.io/r/amoffat/sh?branch=master
:alt: 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:.. code:: python
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
=======
* `Andrew Moffat `_ - author/maintainer
* `Erik Cederstrand `_ - maintainerDevelopers
==========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.