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)
| File | Size | Uploaded | |
|---|---|---|---|
| shell_interface-3.0.0.tar.gz | 21.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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}
|