Registry / devops / bash
library0.6pypypi✓ verified 84d ago

Bash for Python is a library that allows you to run bash commands as Python function calls. Current version 0.6, last updated in 2013, no recent releases (abandoned).

pip install bash==0.6
INSTALL
IMPORT
SIG · BASH
B
bash
devopspythonv0.6
Install
2.6s avg
Import
15ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.016s · 19.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.6s · import 0.014s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

bash
import bash

Run bash commands by calling them as functions. Use keyword arguments for flags.

import bash result = bash.ls('-l') print(result)
Debug
Known issues
gotchaArguments are joined with spaces; do not pass untrusted input without quoting. e.g., bash.cat('file.txt') is safe, but bash.grep(f'-e {user_input}') may allow injection.
fix
Use shell escaping or prefer subprocess for dynamic commands.
affects: all
gotchaSet interpreter path via bash.settings.bash='/bin/bash' on systems where bash is elsewhere (e.g., NixOS). Defaults to /bin/bash.
fix
import bash; bash.settings.bash='/usr/bin/bash'
affects: all
deprecatedLibrary is unmaintained since 2013, no Python 3 compatibility fixes. May not work with newer Python versions.
fix
Consider alternatives: sh, plumbum, subprocess.
affects: >0.6
Errors
Common errors & fixes
ImportError: No module named bash
Library not installed or Python 3 incompatible if installed incorrectly.
fix
pip install bash==0.6
TypeError: 'NoneType' object is not callable
Command not found in PATH returns None; trying to call it as a function raises error.
fix
Check that the command exists and is in PATH before calling.
Upgrade
Version history
0.6latest on PyPI · released May 30, 2016
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
14
OpenAI (training)
1
Resources
bash — pip install bash · libregistry