Skip to main content

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 output
    • pip() for install, uninstall, list, upgrade
    • clear() for screen clearing
    • list_dir() for directory listing
    • chdir() and get_cwd() for navigation
    • run_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terminalexecute-1.0.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terminalexecute-1.0.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

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

Hashes for terminalexecute-1.0.1.tar.gz
Algorithm Hash digest
SHA256 873139f07e2d254fa9490fd1bb7ca37341f2c146028c8a0417af76fbfadad3f9
MD5 3f0ef8eb9c2d955b89a06cc685324ff9
BLAKE2b-256 db664e5ef5741c5f1da1d47d5356a1779f379fa33b037df10d501ea35b0008b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for terminalexecute-1.0.1.tar.gz:

Publisher: terminalExecute.yml on ahk4918/terminalExecutepy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file terminalexecute-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for terminalexecute-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a9a279f2753cc46a47d77548c87bee9a6385a12fd678f996fb1d610d84a0da40
MD5 482d468ca7d87470c82d60f63991fa5a
BLAKE2b-256 80f5634d31e3fa4b5799ed0e55c38692b7ff6bb524303483055cdbc4528d132b

See more details on using hashes here.

Provenance

The following attestation bundles were made for terminalexecute-1.0.1-py3-none-any.whl:

Publisher: terminalExecute.yml on ahk4918/terminalExecutepy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page