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] [-d] [-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 ."

                        command modes:

                        can also provide modes to commands to do extra things:

                            "tail=10 :: pytest ." <-- only output the last 10 lines, doesn't work in --no-stream mode

options:
  -h, --help            show this help message and exit
  -d, --debug           output debug info for each command
  -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 ." \
        "tail=20 :: 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
  • Add custom parsing of command output to support filtering for errors (like vim's errorformat)
  • Add graceful Ctrl-C interrupt handling
  • Provide a way to set environment variables for each command to run with
  • 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
  • Add custom config file for pyallel to read from as an alternative to providing arguments via the command line
  • Add support for providing config via a [tool.pyallel] section in a pyproject.toml file in the current working directory
  • Maybe allow command dependencies to be defined in a python file where commands are decorated with info that details it's dependencies?
  • Add test suite
  • Improve error handling when parsing provided commands (check they are valid executables)

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.6.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

pyallel-0.6.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyallel-0.6.0.tar.gz
Algorithm Hash digest
SHA256 23dc8e0433665675aed73d62c44a0c2d4951e89a4f8c871c4add7ef3f2a37b2e
MD5 e4dbaabedcaee5c546c7c0b9d204943c
BLAKE2b-256 8035b13d2ad3ce026663f95c0764a3c91b3a642252fc43d7d1aeaeec36a9432c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyallel-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db7bd346002f759159274faf9d83b45c5013bfcf5b6ca7e74fda32ea3b6fc904
MD5 e7bbef4125ff4a9b45a95aefe951509a
BLAKE2b-256 add59b04d68fbee1e9a4baac38548140e0b36ecba298bd53a7a001b612cc32c1

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