Execute terminal commands from Python easily.
Project description
terminalexecutepy
terminalexecutepy provides a high‑level Python interface for running terminal commands, managing shells, executing scripts, and performing common developer tasks. It wraps Python’s subprocess module with a clean, ergonomic API and includes OS‑aware shell selection for Windows and Unix systems.
Features
- OS‑aware shell selection (
cmd,powershell,bash,zsh,sh) - Execute any terminal command with automatic error handling
- Convenience helpers:
echo()for quick outputpip()for install, uninstall, list, upgradeclear()for screen clearinglist_dir()for directory listingchdir()andget_cwd()for navigationrun_script()for executing script files
- File and directory utilities:
make_dir(),remove_file(),remove_dir(),copy_file(),move()
- System information:
whoami(),env(),cpu_info(),memory_info()
- Network helpers:
ping(),ipconfig(),curl()
- Git helpers:
git_clone(),git_status(),git_pull(),git_commit(),git_push()
- Works on Windows, macOS, and Linux
- No external dependencies
Installation
Install from PyPI:
pip install terminalexecutepy
Or install directly from GitHub:
pip install git+https://github.com/ahk4918/terminalExecutepy.git
Usage
Importing
from terminalExecutepy.terminalExecute import Terminal, Shells
Basic Example:
term = Terminal()
term.echo("Hello from terminalexecutepy!")
Selecting a Shell:
# Windows
term.shell = Shells.CMD
term.shell = Shells.POWERSHELL
# Unix
term.shell = Shells.BASH
Running Commands:
term.run("echo Running a command")
Using the pip command:
term.pip("install", "requests")
term.pip("list")
term.pip("upgrade", "pip")
term.pip("uninstall", "somepackage")
Directory Tools:
term.list_dir()
term.chdir("..")
term.get_cwd()
term.make_dir("newfolder")
term.copy_file("a.txt", "backup/a.txt")
term.move("backup/a.txt", "a.txt")
term.remove_file("old.txt")
System Info:
term.whoami()
term.env()
term.cpu_info()
term.memory_info()
Network Commands:
term.ping("google.com")
term.ipconfig()
term.curl("https://example.com")
Git Commands:
term.git_clone("https://github.com/user/repo.git")
term.git_status()
term.git_pull()
term.git_commit("Updated project")
term.git_push()
Running Scripts:
term.run_script("myscript.sh")
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 terminalexecute-1.0.1.tar.gz.
File metadata
- Download URL: terminalexecute-1.0.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
873139f07e2d254fa9490fd1bb7ca37341f2c146028c8a0417af76fbfadad3f9
|
|
| MD5 |
3f0ef8eb9c2d955b89a06cc685324ff9
|
|
| BLAKE2b-256 |
db664e5ef5741c5f1da1d47d5356a1779f379fa33b037df10d501ea35b0008b5
|
Provenance
The following attestation bundles were made for terminalexecute-1.0.1.tar.gz:
Publisher:
terminalExecute.yml on ahk4918/terminalExecutepy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
terminalexecute-1.0.1.tar.gz -
Subject digest:
873139f07e2d254fa9490fd1bb7ca37341f2c146028c8a0417af76fbfadad3f9 - Sigstore transparency entry: 1005372164
- Sigstore integration time:
-
Permalink:
ahk4918/terminalExecutepy@234a619ccf432ed07144d845b39388670dedf674 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/ahk4918
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
terminalExecute.yml@234a619ccf432ed07144d845b39388670dedf674 -
Trigger Event:
push
-
Statement type:
File details
Details for the file terminalexecute-1.0.1-py3-none-any.whl.
File metadata
- Download URL: terminalexecute-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.8 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 |
a9a279f2753cc46a47d77548c87bee9a6385a12fd678f996fb1d610d84a0da40
|
|
| MD5 |
482d468ca7d87470c82d60f63991fa5a
|
|
| BLAKE2b-256 |
80f5634d31e3fa4b5799ed0e55c38692b7ff6bb524303483055cdbc4528d132b
|
Provenance
The following attestation bundles were made for terminalexecute-1.0.1-py3-none-any.whl:
Publisher:
terminalExecute.yml on ahk4918/terminalExecutepy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
terminalexecute-1.0.1-py3-none-any.whl -
Subject digest:
a9a279f2753cc46a47d77548c87bee9a6385a12fd678f996fb1d610d84a0da40 - Sigstore transparency entry: 1005372167
- Sigstore integration time:
-
Permalink:
ahk4918/terminalExecutepy@234a619ccf432ed07144d845b39388670dedf674 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/ahk4918
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
terminalExecute.yml@234a619ccf432ed07144d845b39388670dedf674 -
Trigger Event:
push
-
Statement type: