Skip to main content

This package adds the posibility of running commands in a shared shell

Project description

Shared shell for launching processes in Python

The purpose of this package is to provide a simple way to launch processes in Python but in the same shell. Only one shell is allocated and all the processes are launched in order. There is no need to allocate a different shell on each execution, and therefore it benefits from faster execution and a smaller memory footprint.

Getting started

Installation via pip:

pip install sharedshell

Using it:

from sharedshell import SharedShell

with SharedShell() as shell:
    print(shell.run('echo 1').stdout)
    print(shell.run('echo 2').stdout)
    print(shell.run('echo 3').stdout)

Output:

1
2
3

Benchmarking:

┌---------------------
| os.system
└--------------------
command: Mean +- std dev: 9.22 sec +- 2.33 sec
┌---------------------
| subprocess
└---------------------
command: Mean +- std dev: 7.48 sec +- 1.92 sec
┌---------------------
| sharedshell
└---------------------
command: Mean +- std dev: 2.11 sec +- 0.03 sec

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

sharedshell-0.0.3.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file sharedshell-0.0.3.tar.gz.

File metadata

  • Download URL: sharedshell-0.0.3.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for sharedshell-0.0.3.tar.gz
Algorithm Hash digest
SHA256 1c62ddc372d1e311ae2bb6c3a604e25de8edad637ac7b55b267a8193eb384f18
MD5 c14b1772ab5f8c6f72e8611aaa4d67ff
BLAKE2b-256 b9b51bfce1d3f85556d8b2169b4dbd19db5cb5c342343a12d3b551f4bde3c8e4

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