A Python framework for parallel execution with automatic dependency resolution and variable capture.
Project description
Ripplex
A Python framework for parallel execution with automatic dependency resolution and variable capture.
Features
- @flow decorator: Automatically parallelize function execution based on dependencies
- @loop decorator: Simple parallel loops with automatic variable capture
- Visual debugging: See execution progress in real-time
- Error handling: Multiple strategies for dealing with failures
- Zero-config: Works out of the box with sensible defaults
Installation
pip install ripplex
Quick Start
Simple Parallel Loop
from ripplex import loop
items = [1, 2, 3, 4, 5]
multiplier = 10
@loop(items)
def process(item):
# 'multiplier' is automatically captured from the outer scope!
return item * multiplier
print(process) # [10, 20, 30, 40, 50]
Automatic Parallelization with @flow
from ripplex import flow
import time
@flow(debug=True)
def data_pipeline():
# These run in parallel automatically
data1 = fetch_source_1()
data2 = fetch_source_2()
# This waits for both to complete
combined = merge(data1, data2)
# These transformations run in parallel
result1 = transform_a(combined)
result2 = transform_b(combined)
return result1, result2
Error Handling
@loop(items, on_error="collect")
def safe_process(item):
return risky_operation(item)
if not safe_process.all_successful:
print(f"Failed items: {safe_process.errors}")
Progress Tracking
@loop(large_list, debug=True)
def slow_operation(item):
# Progress bar shows automatically
return expensive_computation(item)
API Reference
@flow(debug=False)
Decorator that analyzes function dependencies and runs independent operations in parallel.
debug: Show visual execution timeline
@loop(iterable, *, workers=None, debug=False, on_error="continue")
Decorator for parallel loops with automatic variable capture.
iterable: Items to process (or an int for range)workers: Number of threads (default: number of items, max 32)debug: Show progress baron_error: How to handle errors"continue": Skip failed items (default)"raise": Stop on first error"collect": Continue but keep None for failed items
pmap(fn, iterable, **kwargs)
Functional alternative to @loop decorator.
from ripplex import pmap
results = pmap(lambda x: x ** 2, [1, 2, 3, 4])
Advanced Features
Nested Loops in Flows
@flow(debug=True)
def complex_pipeline():
categories = fetch_categories()
@loop(categories)
def process_category(cat):
items = fetch_items(cat)
@loop(items)
def process_item(item):
# Both 'cat' and 'item' are available
return transform(item, cat)
return summarize(process_item)
return process_category
Custom Worker Pools
# Limit parallelism for resource-intensive tasks
@loop(items, workers=4)
def gpu_operation(item):
return heavy_compute(item)
Debugging
Both decorators support visual debugging:
@flow(debug=True): Shows execution DAG and timing@loop(items, debug=True): Shows progress bar with success/error counts
Contributing
PRs welcome! Please include tests for new features.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ripplex-1.0.0.tar.gz.
File metadata
- Download URL: ripplex-1.0.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ef59d3fd56d1f0a22d989a4a09422b81adb987ecfe75007071eb3460dc25c1b
|
|
| MD5 |
f8c6317211b1bf70e280eea574a3816d
|
|
| BLAKE2b-256 |
0f1568f982f9da71bbc8f62533983b2136cbd2274386faaa1753d36a22f444f2
|
Provenance
The following attestation bundles were made for ripplex-1.0.0.tar.gz:
Publisher:
publish.yml on SethBurkart123/ripplex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ripplex-1.0.0.tar.gz -
Subject digest:
2ef59d3fd56d1f0a22d989a4a09422b81adb987ecfe75007071eb3460dc25c1b - Sigstore transparency entry: 233999681
- Sigstore integration time:
-
Permalink:
SethBurkart123/ripplex@408107bb89899dcaa6d90691b36a00890e8c54aa -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/SethBurkart123
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@408107bb89899dcaa6d90691b36a00890e8c54aa -
Trigger Event:
release
-
Statement type:
File details
Details for the file ripplex-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ripplex-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3977fd19fbc002f7c8aed79297865a820089ed1a577a93ee7216a838d2a1f9b
|
|
| MD5 |
68790e7d5f921fe7d989959230707486
|
|
| BLAKE2b-256 |
93abbefd21ba5dcb17140d74249426c3ae6f522fe130baf101e925b8fb7f12b6
|
Provenance
The following attestation bundles were made for ripplex-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on SethBurkart123/ripplex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ripplex-1.0.0-py3-none-any.whl -
Subject digest:
e3977fd19fbc002f7c8aed79297865a820089ed1a577a93ee7216a838d2a1f9b - Sigstore transparency entry: 233999694
- Sigstore integration time:
-
Permalink:
SethBurkart123/ripplex@408107bb89899dcaa6d90691b36a00890e8c54aa -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/SethBurkart123
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@408107bb89899dcaa6d90691b36a00890e8c54aa -
Trigger Event:
release
-
Statement type: