Skip to main content

Support for writing shell scripts in Python

Project description

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.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

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

libPyshell-0.3.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

libPyshell-0.3.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file libPyshell-0.3.0.tar.gz.

File metadata

  • Download URL: libPyshell-0.3.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for libPyshell-0.3.0.tar.gz
Algorithm Hash digest
SHA256 74372198fcaea77e94508b6f4333543e37846e6aa0403b2ffe2d0a75cf936ed4
MD5 accf4140d121fc5bc2dbfa659093a2b2
BLAKE2b-256 8e1c759f4f6223879f4349156e3a7487899ea04624262e4ef1cbd40106b8ae3e

See more details on using hashes here.

File details

Details for the file libPyshell-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: libPyshell-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for libPyshell-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed789c6466b4c5fd93e761c31c71e9e05076efd4f0639f987f5ae8fa39c0c35d
MD5 82b44ba64b8f7ffbc5057c96cc3e89be
BLAKE2b-256 d13b8e8d1b374bc90925618bee28058c66319ce45c3207e69e1238a550d66263

See more details on using hashes here.

Supported by

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