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-1.0.2.tar.gz (15.3 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-1.0.2-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for shell_interface-1.0.2.tar.gz
Algorithm Hash digest
SHA256 7120dce6fcf11ab45b2cd24fbcc881666a1861c1b88f53773ec3702646b26856
MD5 2fd75b3c121a46ef9df878e7bba40d78
BLAKE2b-256 a08f648efc24a3cf77ad2161c8379dcd604e165b3147925d554359d65d42b2e1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for shell_interface-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2e8fdd5bfaca5be19caf718122836f4b95b96a8efce4e8942790e350539d9a93
MD5 b2b45af4d8ea9f7bb99fbbcf67ad171b
BLAKE2b-256 b67a01f195b3b083f758c3ce797dcbf4f52603bcbdbe1b3397d52d8bb2f99d42

See more details on using hashes here.

Provenance

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