Simplify the use of Bash/Shell commands in Python
Project description
Py-Bash-Wrapper
Description
Py Bash Wrapper helps Python developers run bash/shell/subprocess commands with two convenience functions:
- The
run_commandfunction provides no advances shell features likes pipes. This function takes in either a string or an argv list. - The
run_bashfunction provides real Bash (e.g., pipes, redirects, globs, etc.). This function takes in a string.
Results come back as CommandResult with stdout, stderr, exit code, and an ok flag;
The argument check=True will cause failures to raise a CommandError.
Installation
From PyPI:
pip install py_bash_wrapper
Documentation
- Usage examples -- safe patterns,
run_commandvs.run_bash, errors and post-checks. - Project structure -- where code, tests, and automation live.
- Code style -- Ruff, Mypy, pytest, and conventions.
- Maintainers -- versions, CI, releases, security notes for shell APIs.
- Plan / roadmap -- upcoming tasks.
Security note
run_bash executes shell code. Do not pass untrusted input as the Bash command string. Prefer run_command
with a fixed argv when shell features are not required. See docs/usage_examples.md.
Initial setup
Prerequisites:
- uv (package and tool runner):
- macOS:
brew install uv(see Homebrew if needed). - Other: Installing uv (official installer and package managers).
- macOS:
- make:
- macOS: Xcode Command Line Tools or a build toolchain that provides
make. - Linux: install
build-essential. - Windows: use Git Bash, WSL, or another environment that provides
make, or run the sameuv run ...commands from the Makefile by hand.
- macOS: Xcode Command Line Tools or a build toolchain that provides
- Python 3.12+: install via OS package manager, via
uvwithuv python install 3.12, or via python.org.
Versioning
Releases follow SemVer.
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
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 py_bash_wrapper-0.3.5.tar.gz.
File metadata
- Download URL: py_bash_wrapper-0.3.5.tar.gz
- Upload date:
- Size: 25.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e9e35163a21dc90c7760990f94e9c13d46d30755d1ce2161a517ceaac2cc918
|
|
| MD5 |
64e21a0b0556477c65c3be3932fefa81
|
|
| BLAKE2b-256 |
944084f711c1fabedcfd4e8a67076175f7228066134620c787b67f0b31e96b7d
|
Provenance
The following attestation bundles were made for py_bash_wrapper-0.3.5.tar.gz:
Publisher:
release-from-version.yml on themarkrogers/py_bash_wrapper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_bash_wrapper-0.3.5.tar.gz -
Subject digest:
3e9e35163a21dc90c7760990f94e9c13d46d30755d1ce2161a517ceaac2cc918 - Sigstore transparency entry: 1274274643
- Sigstore integration time:
-
Permalink:
themarkrogers/py_bash_wrapper@2c95a09a3c262efadf622a040b18b6c93673df02 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/themarkrogers
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-from-version.yml@2c95a09a3c262efadf622a040b18b6c93673df02 -
Trigger Event:
push
-
Statement type:
File details
Details for the file py_bash_wrapper-0.3.5-py3-none-any.whl.
File metadata
- Download URL: py_bash_wrapper-0.3.5-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99fb931b774e9611d8dd18f07dc897841b9999ec46fd9c8f86b714cd977280ee
|
|
| MD5 |
c823cc46fe9aa8913f0162a0b35a175e
|
|
| BLAKE2b-256 |
b1a1870c9ca41582a864481c16ecdd98e064b0a14b279909110643959a41c67f
|
Provenance
The following attestation bundles were made for py_bash_wrapper-0.3.5-py3-none-any.whl:
Publisher:
release-from-version.yml on themarkrogers/py_bash_wrapper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_bash_wrapper-0.3.5-py3-none-any.whl -
Subject digest:
99fb931b774e9611d8dd18f07dc897841b9999ec46fd9c8f86b714cd977280ee - Sigstore transparency entry: 1274274746
- Sigstore integration time:
-
Permalink:
themarkrogers/py_bash_wrapper@2c95a09a3c262efadf622a040b18b6c93673df02 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/themarkrogers
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-from-version.yml@2c95a09a3c262efadf622a040b18b6c93673df02 -
Trigger Event:
push
-
Statement type: