Skip to content

API Reference

This is a summary of the public API. For the most detailed and up-to-date documentation, refer to the docstrings in the source code.

papy.core

The core module provides the main classes for constructing and running pipelines.

Class Description
Worker Composes sequences of functions with optional arguments.
Piper Processing node wrapping a Worker with evaluation mode.
Dagger Directed acyclic graph defining the pipeline topology.
Plumber High-level interface to run and interact with a pipeline.
WorkerError Exception related to Worker instances.
PiperError Exception related to Piper instances.
DaggerError Exception related to Dagger instances.
PlumberError Exception related to Plumber instances.

papy.graph

Low-level graph data structure used by Dagger.

Class Description
DictNode Topological node of a DictGraph.
DictGraph Dictionary-based directed graph without explicit edges.

numap.NuMap

Parallel map function with thread, process, or sub-interpreter pool.

Class / Function / Constant Description
NuMap Parallel, buffered, multi-task, lazy map function.
imports Decorator to attach import statements to functions.
HASINTERP True if concurrent.interpreters (Python 3.14+) is available.

NuMap key arguments

Argument Values Default Notes
worker_type 'process', 'thread', 'interpreter' 'process' 'interpreter' requires Python 3.14+; incompatible with worker_remote.
worker_num int CPU count Number of local workers.
worker_remote list of [host, n] None Remote workers via RPyC; not supported with 'interpreter'.
stride int auto Tasklets submitted per task per cycle.
buffer int auto Maximum pending results across all tasks.
ordered bool True Preserve input order in results.
skip bool False Skip results that exceed timeout.

papy.util.func

Worker functions for pipeline I/O and data manipulation.

Function Description
plugger Returns None.
ipasser Passes the i-th input from inbox.
npasser Passes the first n inputs from inbox.
spasser Passes inputs with indices in s.
nzipper Zips the first n inputs from inbox.
szipper Zips inputs with indices in s.
njoiner String-joins the first n inputs.
sjoiner String-joins inputs with indices in s.
dump_stream Writes items to a stream with delimiters.
load_stream Creates a generator from a delimited stream.
dump_item Writes an item as a file, FIFO, or socket.
load_item Loads an item from a file, FIFO, or socket.
pickle_dumps Serializes to pickle bytes.
pickle_loads Deserializes from pickle bytes.
json_dumps Serializes to JSON string.
json_loads Deserializes from JSON string.
make_lines Creates a line generator from a file handle.

papy.util.script

Execute arbitrary scripts from within a pipeline.

Function Description
script Execute a script with a configuration dictionary.
write_template Write a language-specific script template.
get_config Get a language-specific script configuration.

papy.util.config

Function Description
start_logger Configure the logging system.
get_defaults Get default configuration values.

papy.util.runtime

Function Description
get_runtime Get runtime state dictionary.