ga-parallel
parallel provides a single Parallel helper class that runs a function over
a collection of tasks using a selectable execution engine: plain threading,
joblib, dask, or
ray. The engine is chosen at runtime, so the same code
can scale from a laptop to a cluster without changes.
The PyPI distribution is named ga-parallel; the import package is named
parallel.
Installation
python -m pip install ga-parallel
dask, ray, and joblib are optional third-party engines and are not
installed by default. Install only the engines you need as extras:
python -m pip install "ga-parallel[dask]"
python -m pip install "ga-parallel[ray]"
python -m pip install "ga-parallel[joblib]"
Install every optional engine at once with:
python -m pip install "ga-parallel[all]"
Development and test tools are available as extras:
python -m pip install -e ".[test]"
python -m pip install -e ".[dev]"
Quick Start
from parallel import Engine, Parallel
def double(tasks: list[dict]) -> list[int]:
return [task["value"] * 2 for task in tasks]
tasks = [{"value": i} for i in range(10)]
runtime = Parallel(num_cpus=2, engine=Engine.MULTITHREADING)
results = runtime.map_list(double, tasks)
runtime.shutdown()
engine may also be passed as a string, for example "threading" or "ray".
The library normalizes it via Engine.parse(...).
For scoped execution, use the runtime as a context manager:
with Parallel(num_cpus=2, engine=Engine.MULTITHREADING) as runtime:
results = runtime.map_list(double, tasks)
Engines
Each Parallel instance owns its engine state and supports the following
engines, selected via the engine argument of the constructor, configure(...)
or map(...):
Engine.NONE- sequential execution (default with a single CPU).Engine.MULTITHREADING-concurrent.futures.ThreadPoolExecutor.Engine.JOBLIB-joblib.Parallelwith thelokybackend (requires thejoblibextra).Engine.DASK- a local Daskdistributedcluster with multi-process workers (requires thedaskextra).Engine.DASK_MULTITHREADING- a local Daskdistributedclient with a single multi-threaded worker (requires thedaskextra).Engine.RAY- a local or remote Ray cluster (requires therayextra).
If an engine's dependency is missing, Parallel falls back to
Engine.MULTITHREADING and logs a warning.
API Overview
Parallel(num_cpus=None, engine=None, log=None, **kwargs)creates and configures an independent runtime instance.Parallel.configure(num_cpus=None, engine=None, log=None, **kwargs)configures that instance and returns the number of usable CPUs.Parallel.map(fn, tasks, engine=None, n_workers=None, chunk_size=None, **kwargs)splitstasksinto chunks and yields the result offnfor each chunk.Parallel.map_list(fn, tasks, engine=None, n_workers=None, chunk_size=None, **kwargs)eagerly executesmapand returns a flat list of results.Parallel.apply(fn, params, engine=None, **kwargs)runsfnonce with a single task payload.Parallel.session(...)creates a configured instance suitable for awithblock.Parallel.shutdown(force=False)releases the resources owned by that instance.
Release files for ga-parallel 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ga_parallel-0.1.1.tar.gz | 27.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ga_parallel-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.2 kB
Release files / ga_parallel-0.1.1.tar.gz
| Download URL | ga_parallel-0.1.1.tar.gz |
|---|---|
| Size | 27.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f119310e4f584d9e87be26b12bea489911b30845add4b459d394f52f165d73ab
|
|
BLAKE2b-256 checksum How to use checksums |
5faf24fe64ca6fa67d1cd2a34bf45dbdb44702652f66aa6861bb9bdf8ba57289
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / ga_parallel-0.1.1-py3-none-any.whl
| Download URL | ga_parallel-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cfd7f591135fada98487a4e0038028fb4b3cd8bdebe0c98f2c79020abbfa0aac
|
|
BLAKE2b-256 checksum How to use checksums |
2829cd9c736770f89ce406990cc7f22230100ad1fb4624c49ae27650f1380df8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency log