Skip to main content

Pyshell

A python module for writing shell-scripts in Python. It introduces new functionality, bundles functions distributed over several modules of Python's standard library in one place and provides several auxiliary functions.

The function's provided by the shell module are named after the corresponding Unix commands.

Here's a quick demo:

from shell import *

rm('a/b/foo.txt')
mv('X.pdf', f'{HOME}/contents.pdf')

files = ls('Documents', '*.txt', '*.c')
magicFiles = run(['grep', 'magic'] + files, captureStdout=splitLines, onError='ignore').stdout

Changelog

  • 0.6.6 (2026-07-01)

    • switch to static typing
    • make the package PEP 561-typed
  • 0.5.0 (2025-03-11)

    • support of timeouts for run
  • 0.4.1 (2024-09-12)

    • fix capture handling
    • add failOnError option to rm commands
  • 0.4.0 (2024-03-20)

    • re-implement run in terms of subprocess.run. This fixes a bug that caused stdout to disappear.
  • 0.3.0 (2024-02-01)

    • uniform treatment when capturing stdout and stderr. This lead to changes to RunResult and RunError which are slightly backwards incompatible.
  • 0.2.0 (2024-01-29)

    • Better static type information
  • 0.1.7 (2023-03-30)

    • force parameter for cp
  • 0.1.5 and 0.1.6 (2023-03-03)

    • Some bugfixes
  • 0.1.4 (2022-03-17)

    • Flush stdout and stderr before running a command

Download files

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

Source Distribution

libpyshell-0.6.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

libpyshell-0.6.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file libpyshell-0.6.0.tar.gz.

File metadata

  • Download URL: libpyshell-0.6.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for libpyshell-0.6.0.tar.gz
Algorithm Hash digest
SHA256 2fd8fddcbc0a08311ae1ded024a5a9c3794a1fe70c754fb5565a1788e9d19ab0
MD5 e9b190b6c0d2ffa410094656479af648
BLAKE2b-256 8c6298b32c9a06c4a645494751fb9ba9d490c9d1e7f76fd9b7ef7ff64e830513

See more details on using hashes here.

File details

Details for the file libpyshell-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: libpyshell-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for libpyshell-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b139cbd718843ca4cc56e5c33e7f1673b9994e3332ce0531c11e342317dd246
MD5 7c9cb9341ff89930885b16f0fb77433e
BLAKE2b-256 46a2ae290ae7c73ae28c4e66afe98e53eb4b0698ea958cce307a86f8c1006e6b

See more details on using hashes here.

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