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

SciTeX

Safe subprocess wrapper — list-only (no shell-string parsing), structured result, timeouts, streaming.

Full Documentation · pip install scitex-sh


Installation

pip install scitex-sh

Quick Start

import scitex_sh as sh

res = sh.sh(["git", "status"])
print(res["stdout"])

1 Interfaces

Python API
import scitex_sh as sh

# Dict result (stdout / stderr / returncode / success)
res = sh.sh(["git", "status"])

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

# Streamed output
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.

Part of SciTeX

scitex-sh is part of SciTeX.

Four Freedoms for Research

  1. The freedom to run your research anywhere — your machine, your terms.
  2. The freedom to study how every step works — from raw data to final manuscript.
  3. The freedom to redistribute your workflows, not just your papers.
  4. The freedom to modify any module and share improvements with the community.

AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.

License

AGPL-3.0-only (see LICENSE).


SciTeX

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.2.tar.gz (21.3 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.2-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scitex_sh-0.1.2.tar.gz
  • Upload date:
  • Size: 21.3 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.2.tar.gz
Algorithm Hash digest
SHA256 69ceb2985e6cd8a8fb3985661e8c752cdfe85b1ec35536f85c5f6b3b75f54584
MD5 9d3509abf939997332c7b7043ae7b4ab
BLAKE2b-256 e11bc60a6e3c3a6aff666d4ea441b5a70c2d4a6876ba9859470c79da60716101

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_sh-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: scitex_sh-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 21.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f7203d6796cd8bad8d23c9434b05146037b9394a37609034519aaefa389fd9c5
MD5 cc8c3883d2aa335e6837a3ce5ad126eb
BLAKE2b-256 d0a0713b43106cbf84e5977ee797d8ecde29748f6c48691978867a879e4be3f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_sh-0.1.2-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