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

Uploaded Source

File details

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

File metadata

  • Download URL: parallelprocs-0.1.5.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for parallelprocs-0.1.5.tar.gz
Algorithm Hash digest
SHA256 16055d1373ec723c74f60f035da1316f3af4107ececafe440e4fdacae0d54d0e
MD5 0e6c345c5e0f3222d9a3eb2113a83910
BLAKE2b-256 0a4dc687ab5e35dfba80ef404520186a358ae0cce58cd5612f1597c77e35cfa0

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