Skip to main content

Safe subprocess wrapper (list-only, no shell injection) with stream/timeout support — standalone module from the SciTeX ecosystem

Project description

scitex-sh

PyPI Python Tests Install Test Coverage Docs License: AGPL v3

Safe subprocess wrapper extracted from the SciTeX ecosystem as a standalone, zero-dep package.

List-only (no shell-string parsing) → no shell-injection. Stream output, timeouts, structured ShellResult return.

Install

pip install scitex-sh

API

import scitex_sh as sh

# Dict result with stdout/stderr/returncode/success
res = sh.sh(["git", "status"])
# {"success": True, "stdout": "...", "stderr": "", "returncode": 0, ...}

# String result
out = sh.sh(["ls", "-la"], return_as="str")

# Streamed
sh.sh(["./long-running.sh"], stream_output=True)

# Timeout
sh.sh(["sleep", "10"], timeout=2)

# Lower-level
res = sh.sh_run(["echo", "hi"])
sh.quote("hello world")  # 'hello world' (POSIX-quoted)

Status

Standalone fork of scitex.sh. Zero deps (pure stdlib). The umbrella package's scitex.sh import path is preserved via a sys.modules-alias bridge. The scitex.str.color_text dep used for terminal output is replaced with a tiny inline ANSI helper that respects NO_COLOR and TTY detection.

License

AGPL-3.0-only (see LICENSE).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scitex_sh-0.1.1.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scitex_sh-0.1.1-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file scitex_sh-0.1.1.tar.gz.

File metadata

  • Download URL: scitex_sh-0.1.1.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_sh-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f113832ce4c8b12b28763be62f620d89f976bb70629b8abbc3e27ae0b7b3432d
MD5 85471359d82d143c37a8b07f940e91e3
BLAKE2b-256 162f941a62f79eca77f2a9820965df446054119d6eff333900950d8eb40ea053

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_sh-0.1.1.tar.gz:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-sh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scitex_sh-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: scitex_sh-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_sh-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 960cd4c9029d7ae742897c3648f907ee214019726d98c7682d4dad124b48aae6
MD5 b57afda5c36e6dd5b74c6345de01fc5a
BLAKE2b-256 61856614aac237b0bc161b1989c8f6f26103f051b8df89578efa94bd07e09d18

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_sh-0.1.1-py3-none-any.whl:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-sh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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