Metadata-Version: 2.4
Name: shell-interface
Version: 1.0.2
Summary: Helpful and convenient utilities to interact with UNIX shells
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Author: Max Görner
Author-email: 5477952+MaxG87@users.noreply.github.com
Requires-Python: >=3.9
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Provides-Extra: logging
Requires-Dist: loguru ; extra == "logging"
Project-URL: Changelog, https://github.com/MaxG87/shell-interface/blob/main/CHANGELOG.md
Project-URL: Homepage, https://github.com/MaxG87/shell-interface
Project-URL: Issues, https://github.com/MaxG87/shell-interface/issues
Project-URL: Repository, https://github.com/MaxG87/shell-interface
Description-Content-Type: text/markdown

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)

# 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

```python
from shell_interface import run_cmd

result = run_cmd(cmd=["ls", "-l"], capture_output=True)
print(result.stdout.decode())
```

### Piping Commands

```python
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

```python
from shell_interface import get_user, get_group

user = get_user()
group = get_group(user)
print(f"User: {user}, Group: {group}")
```

