Metadata-Version: 2.4
Name: mini_bash
Version: 0.1.2
Summary: Easily run bash commands
License: apache
License-File: LICENSE
Author: lamnguyenx
Author-email: lamfm95@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
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
Project-URL: Homepage, https://github.com/lamnguyenx/mini_bash.git
Description-Content-Type: text/markdown

# mini_bash

> **Summary**: A lightweight Python package for executing bash commands programmatically with automatic error handling. Raises an exception if the shell command returns a non-zero exit code.

## Installation

You can install mini_bash using pip:

```bash
pip install mini_bash
```

## Usage

```python
from mini_bash import mini_bash

# Execute a command and capture output
std_out_str, std_err_str = mini_bash('ls -ltr')

# The function returns a tuple of (stdout, stderr)
print(f"Output: {std_out_str}")
print(f"Errors: {std_err_str}")
```

### Error Handling

If the command exits with a non-zero return code, a `subprocess.CalledProcessError` is raised:

```python
from mini_bash import mini_bash

try:
    mini_bash('exit 1')
except Exception as e:
    print(f"Command failed: {e}")
```

## Contribution & License

If you have any suggestions, improvements, or issues regarding **mini_bash**, feel free to [open an issue](https://github.com/lamnt45/mini_bash/issues) or submit a pull request on GitHub.

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

