Skip to main content

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}")

Metadata

Release files for shell-interface 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shell-interface 3.0.0
File Size Uploaded
shell_interface-3.0.0.tar.gz 21.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shell-interface 3.0.0
File Interpreter ABI Platform
shell_interface-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.6 kB

Release files / shell_interface-3.0.0.tar.gz

Download URL shell_interface-3.0.0.tar.gz
Size 21.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ef514aa33c2c800c9218e48fd551e8ef7298f04f9653382aaf9b59b25cb4a80d
BLAKE2b-256 checksum
How to use checksums
75949dba067b54b379f77dfd9e79a53ac0fd17df5c4057fbf5eb34aec3a44dbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / shell_interface-3.0.0-py3-none-any.whl

Download URL shell_interface-3.0.0-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab93f009ab5cab86b1a750bfad46ee315a822ab5d56b779bef6d4e04fe6adf3b
BLAKE2b-256 checksum
How to use checksums
6676b654d85acd608631d235d5fbb5b46f298ee26996b89af7842f29ad3a3e20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

3.0.1

2 release files

This release

3.0.0 This release

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.15.2

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page