Skip to main content

Run and handle the output of multiple executables in pyallel (as in parallel)

Project description

Pyallel

Run and handle the output of multiple executables in pyallel (as in parallel)

https://github.com/Danthewaann/pyallel/assets/22531177/be12efc4-439d-416d-8112-dc57cc4c291a

Requires Python >=3.8

Tested on Linux and MacOS only

Quick start

pyallel can be installed using pip:

pip install pyallel

Once installed, you can run pyallel to see usage information, like so:

usage: pyallel [-h] [-t] [-n] [-s] [-V] [-v] [commands ...]

Run and handle the output of multiple executables in pyallel (as in parallel)

positional arguments:
  commands              list of quoted commands to run e.g "mypy ." "black ."

                        can provide environment variables to each command like so:

                             "MYPY_FORCE_COLOR=1 mypy ."

options:
  -h, --help            show this help message and exit
  -t, --no-timer        don't time how long each command is taking
  -n, --non-interactive
                        run in non-interactive mode
  -s, --no-stream       don't stream output of each command
  -V, --verbose         run in verbose mode
  -v, --version         print version and exit

Currently you can provide a variable number of commands to run to pyallel, like so:

[!IMPORTANT] If you need to provide arguments to a command, you must surround the command and it's arguments in quotes!

pyallel "MYPY_FORCE_COLOR=1 mypy ." \
        "black --check --diff ." \
        "pytest ."

TODOs

  • Allow output for all provided commands to be streamed to stdout (this will require a re-work of how we print command output as we currently just print output once the command finishes)
  • Add CI checks to run the tests and linters against Python versions > 3.8
  • Add command mode arguments to support things like only tailing the last 10 lines of a command whilst it is running e.g. "tail=10 :: pytest ."
  • Add visual examples of pyallel in action
  • Fix bug in non-interactive streamed mode where all commands share the same amount of time taken as the longest running command
  • Fix bug in non-interactive streamed mode where calling readline doesn't account for EOF (if we are at EOF we shouldn't append a newline as more output could be appended to the current line)
  • Fix bug in streamed mode where we should use the number of terminal columns when determining when to truncate the line to fit within the screen (or properly handle wrapped lines)
  • Provide a way to set environment variables for each command to run with
  • Add test suite
  • Improve error handling when parsing provided commands (check they are valid executables)
  • Maybe make tail mode followed by an optional dump of all the command output once it finishes the default behaviour?
  • Add graceful Ctrl-C interrupt handling
  • Setup build system to convert pyallel into a single file executable for ease of use and distribution
  • Add custom parsing of command output to support filtering for errors (like vim's errorformat)
  • Allow list of files to be provided to supply as input arguments to each command
  • Allow input to be piped into pyallel via stdin to supply as standard input to each 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

pyallel-0.11.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

pyallel-0.11.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file pyallel-0.11.0.tar.gz.

File metadata

  • Download URL: pyallel-0.11.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for pyallel-0.11.0.tar.gz
Algorithm Hash digest
SHA256 7f43be8bb73d32ef746e5c7edf5d91dfd8d825690ebd039555010ae133bf70cf
MD5 35d688d5a436ac447055845edae79634
BLAKE2b-256 1188e80af7be8338c350e8fb8d6a48586d7449d5a992a6fab269cf9eff255c28

See more details on using hashes here.

File details

Details for the file pyallel-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: pyallel-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for pyallel-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3becde0c0f9a8e0d95645964b829e71adde27ab6a8e44c345e01c09e54370d91
MD5 e0f3340fb19d4b12c450a0a5acb5e4f4
BLAKE2b-256 0c0a6487c953a3f4079a35779127867639823206b14c8931fbf42b6277e9b5b6

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