Skip to main content

Run command lines via (GNU) parallel

Project description

parallelprocs

Run commands via GNU Parallel or something like it.

Synopsis

$ cat test.py
#!/usr/bin/env python

from parallelprocs import run

try:
    run(['echo foo', 'echo bar', 'echo baz'], verbose=True)
except Exception as e:
    print(e)
$ ./test.py
Running job (# jobs = 3)
bar
baz
foo

Description

The module exposes a single function run that takes the following arguments:

Required Arguments:

commands [str]: commands

Keyword Options

  • parallel (str): path to "parallel", default "which('parallel')"
  • num_procs (int): num of concurrent processes, default "0" to use all CPUs
  • verbose (bool): print messages to sys.stderr, default "False"
  • halt (int): number of failed jobs to trigger halt, default "0" for no halt

Author

Ken Youens-Clark kyclark@gmail.com

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

parallelprocs-0.1.4.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

parallelprocs-0.1.4-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file parallelprocs-0.1.4.tar.gz.

File metadata

  • Download URL: parallelprocs-0.1.4.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for parallelprocs-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d0a1e3d250b864238677e71f3a4435b331e451c6bd5dadadf30f7149d29ee416
MD5 6d373d2ece71f6d6ea228f491098982d
BLAKE2b-256 1c2c6792c01df6de4f416fca966bc10df77acb6f55e842308a0bc07feaa643ce

See more details on using hashes here.

File details

Details for the file parallelprocs-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: parallelprocs-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for parallelprocs-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 59e7e811fa7113ffc12a5466e253f0deb9a64b9546bbeac4554b1eb3fb2b6ad5
MD5 b269cb3dfa07c9266dd8d17a81c76f3e
BLAKE2b-256 06c4c57e9697f5fded9b26665c5c62ea2896f605be2338160dd4228a61d31cfa

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