shelluha
Shell command execution utilities for Python.
Features
shell_exec()— Execute shell commands with consistent error handlingShellCommand— Create reusable command wrapperscd()— Context manager for temporary directory changes- Pre-initialized commands:
ps,df,du,cat,tar,tail,head,touch,chown,chmod,chgrp,which
Installation
pip install shelluha
Quick Start
from shelluha import shell, ShellCommand
# Execute a command
output = shell.shell_exec("ls -la")
# Create a reusable command
docker = ShellCommand("docker")
docker("ps")
# Temporary directory change
with shell.cd("/tmp"):
shell.shell_exec("pwd")
Documentation
- Getting Started — Installation and basic usage
- API Reference — Complete API documentation