Skip to main content

Helpful and convenient utilities to interact with UNIX shells

Project description

Code style: black Imports: isort Checked with mypy License: GPL v3

Shell Interface

A lightweight Python library providing convenient utilities to interact with UNIX shells.

Features

  • Execute shell commands safely with error handling
  • Pipe the output of one command to another
  • Retrieve system user and group information
  • Logging support with loguru (if installed)

Usage

Running Shell Commands

from shell_interface import run_cmd

result = run_cmd(cmd=["ls", "-l"], capture_output=True)
print(result.stdout.decode())

Piping Commands

from shell_interface import pipe_pass_cmd_to_real_cmd

result = pipe_pass_cmd_to_real_cmd("echo Hello", ["grep", "Hello"])
print(result.stdout.decode())

Getting User and Group Information

from shell_interface import get_user, get_group

user = get_user()
group = get_group(user)
print(f"User: {user}, Group: {group}")

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

shell_interface-2.0.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

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

shell_interface-2.0.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file shell_interface-2.0.0.tar.gz.

File metadata

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

File hashes

Hashes for shell_interface-2.0.0.tar.gz
Algorithm Hash digest
SHA256 bf78d220a7c7fb9a699d1030db7ebc4945829f8f312ce0c130dea95526870ed6
MD5 67eeabf9c425de20b66c5e810504d8dd
BLAKE2b-256 e74d3339a6f734bc1a21f663cf501fe8f525e57de7110b817a3a8993fb89c4ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for shell_interface-2.0.0.tar.gz:

Publisher: python-publish.yml on MaxG87/shell-interface

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

File details

Details for the file shell_interface-2.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for shell_interface-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fcb39b0d680ec67731396f33179181c2c30fbd96c48d0da9c9886037931e676
MD5 22e94178a732acde560d2a162517bd54
BLAKE2b-256 caaa81ed389c0139ff5364c1b06015817cc7f44b84921237aa6fa6d33a5a99dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for shell_interface-2.0.0-py3-none-any.whl:

Publisher: python-publish.yml on MaxG87/shell-interface

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