Skip to main content

Bash_PurePython

PurePython implementations of common bash commands, for use with pyodide.

These are mostly vibe coded, use at your own risk.

Embedding the shell

bash_purepython.shell runs these commands behind a bash-like line syntax without a subprocess, which is what the browser terminal on androsh7.com uses under Pyodide.

from bash_purepython.shell.models import HostCommand
from bash_purepython.shell.session import ShellSession

session = ShellSession(home="/home/user", host_commands=[HostCommand("vim", "open a file")], environment={})
result = session.run_line("echo hello | tr a-z A-Z > out.txt && cat out.txt")
print(result.stdout, result.exit_code, result.cwd)
completion = session.complete("gre", cursor=3)
print(completion.replacement)

Pass output_sink= a callable taking (kind, text) to receive stdout and stderr as they are written instead of in the result. Pipelines run one stage at a time, so only the last stage streams; everything before it is buffered up to OUTPUT_LIMIT_BYTES.

Commands the embedding host runs itself (an editor, a network fetch, a file upload) are declared as HostCommands. The session reports them back as a host_call instead of running them, and refuses them inside a pipeline. bash_purepython.shell.bridge wraps the same calls in JSON strings for hosts that cannot pass Python objects.

Metadata

Release files for bash-purepython 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bash-purepython 0.3.0
File Size Uploaded
bash_purepython-0.3.0.tar.gz 47.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bash-purepython 0.3.0
File Interpreter ABI Platform
bash_purepython-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 115.7 kB

Release files / bash_purepython-0.3.0.tar.gz

Download URL bash_purepython-0.3.0.tar.gz
Size 47.5 kB
Tags Source
SHA-256 checksum
How to use checksums
af5816f0a056fafc09b2dca04e53548b20c25f296fdc1e48b64f7708ab878f6a
BLAKE2b-256 checksum
How to use checksums
04a1d6e6e93709232fe3ec8b77211b7ef59f40964466be79f4f0fb90f5404793
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / bash_purepython-0.3.0-py3-none-any.whl

Download URL bash_purepython-0.3.0-py3-none-any.whl
Size 68.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09780bfc3b2f8a5efb05b05975bc7c3da88b8b1d9da6ce49fad5e794ec5f45dc
BLAKE2b-256 checksum
How to use checksums
77855fc486620bcfe684e3370eb283d9c87364fd7e6dd59d544127e9cb5b3b18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.0

2 release files

0.4.0

2 release files

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page