Helpful and convenient utilities to interact with UNIX shells
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7120dce6fcf11ab45b2cd24fbcc881666a1861c1b88f53773ec3702646b26856
|
|
| MD5 |
2fd75b3c121a46ef9df878e7bba40d78
|
|
| BLAKE2b-256 |
a08f648efc24a3cf77ad2161c8379dcd604e165b3147925d554359d65d42b2e1
|
Provenance
The following attestation bundles were made for shell_interface-1.0.2.tar.gz:
Publisher:
python-publish.yml on MaxG87/shell-interface
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shell_interface-1.0.2.tar.gz -
Subject digest:
7120dce6fcf11ab45b2cd24fbcc881666a1861c1b88f53773ec3702646b26856 - Sigstore transparency entry: 813154128
- Sigstore integration time:
-
Permalink:
MaxG87/shell-interface@668000ce6a03e99e10c2743298c1613d2cbf45a4 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/MaxG87
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@668000ce6a03e99e10c2743298c1613d2cbf45a4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file shell_interface-1.0.2-py3-none-any.whl.
File metadata
- Download URL: shell_interface-1.0.2-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e8fdd5bfaca5be19caf718122836f4b95b96a8efce4e8942790e350539d9a93
|
|
| MD5 |
b2b45af4d8ea9f7bb99fbbcf67ad171b
|
|
| BLAKE2b-256 |
b67a01f195b3b083f758c3ce797dcbf4f52603bcbdbe1b3397d52d8bb2f99d42
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shell_interface-1.0.2-py3-none-any.whl -
Subject digest:
2e8fdd5bfaca5be19caf718122836f4b95b96a8efce4e8942790e350539d9a93 - Sigstore transparency entry: 813154129
- Sigstore integration time:
-
Permalink:
MaxG87/shell-interface@668000ce6a03e99e10c2743298c1613d2cbf45a4 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/MaxG87
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@668000ce6a03e99e10c2743298c1613d2cbf45a4 -
Trigger Event:
release
-
Statement type: