Skip to main content

PAPPLY

Python wrapper to execute command line programs in parallel using multiprocessing.Pool

Description

A very simple wrapper around python's multiprocessing to be able to easily execute command line programs in parallel. It's implementation is inspired by GNU Parallel and Apply.

The basic idea is that one does not have to change much to the original command line to run tasks in parallel.

The first argument is interpreted as the command to execute multiple times, all other arguments are used as the inputs to the command.

Example usage

hello world: papply echo "Hello World" "Hello Papply"

compressing files with GNU gzip:

gzip *.txt

becomes:

papply gzip *.txt

converting images to jpg using ImageMagick's convert:

convert 1.png 1.jpg, convert 2.png 2.jpg, convert 2.png 2.jpg, ...

becomes:

papply "convert %F %n.jpg" *.png

Features

Template replacements

The following strings can appear in the command string (the first argument to papply). They will be replaced by:

  • %F: Full original input
  • %d: directory name (no trailing slash)
  • %f: file name with extension
  • %n: file name without extension
  • %e: extension (with leading .)
  • %z: empty string

Configuration

The basic configuration should work for most use-cases. I have not implemented command line options to papply itself on purpose. This is a choice to keep the interface as simple as possible.

If you want to override the default values you can create a papply.ini file. This file will be looked for first in the directory where you execute the command and second in your home directory. The following parameters can be changed:

  • num_cores: number of cores to use, default all available cores
  • overcommit_factor: how many threads per core to request, default 1
  • show_progress: print progress of the running jobs (yes, no, IfLong), default show progress if running a long time
  • long_duration: time in seconds to be considered long after which progress is shown, default 60

Any values that are not set explicitly will default to the standard value. There is an example ini file included in the distribution (papply.ini.example).

Metadata

Release files for papply 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for papply 0.1.10
File Size Uploaded
papply-0.1.10.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for papply 0.1.10
File Interpreter ABI Platform
papply-0.1.10-py3-none-any.whl Python 3 none any Details

Total release size: 10.3 kB

Release files / papply-0.1.10.tar.gz

Download URL papply-0.1.10.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a610d6020b6d4c0ebfb227c49c825d9090780b6fe816c7d62bf5baae647155f0
BLAKE2b-256 checksum
How to use checksums
da13525d47b301e4dfc42da64c1cbc677e06e92c8c9ef4ca3f6c6852859db175
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / papply-0.1.10-py3-none-any.whl

Download URL papply-0.1.10-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c8a46836744751124f5a8bfb559df7416a966a0fc756365f3a22c8b4c07901f
BLAKE2b-256 checksum
How to use checksums
b25fd1da8e6303a79bd349331eda6a188f06f8494570a9301cc896f7c6cd120b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

0.1.10 This release

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page