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.1.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.1.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shell_interface-2.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 9ac7df9f55b3e787758797c7ef659e8b56d4b7f5f968b9bbdfdd18ddab9bb317
MD5 1892398cb1f41ec5cf4afd3fbabda8f5
BLAKE2b-256 e12368efe8cccdc2f27ef9524effcc765d2ebfcf39ca4cddc541364a411ac4aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for shell_interface-2.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: shell_interface-2.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e5a7bc202fda3c74d901a452e7975db0b580f5229ecb55f5488752180e55ed3
MD5 7840c070510331e4e3ed18cab89ac127
BLAKE2b-256 ea8619920b883ed19c7a33ecb11043cb6a78aa14f80cca8ea95e9e541cae367a

See more details on using hashes here.

Provenance

The following attestation bundles were made for shell_interface-2.1.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