Skip to main content

🐍⚡ pyodide-pool

Run Python callables and dask graphs in parallel on a pool of Pyodide Web Workers.

🔗 Live Demo · Source

A single Pyodide interpreter is strictly single-threaded (no -pthread, no fork), so parallelism means many interpreters. pyodide-pool is the driver-side Python API for a pool of Web Workers (browser) or worker_threads (Node), each hosting its own Pyodide interpreter:

  • submit — run one cloudpickled call on a worker and await its result.
  • compute / get — an async dask scheduler that executes dask.delayed / dask.bag / dask-array graphs in parallel on the pool.
  • Package mirroring — packages loaded in the driver (e.g. numpy) are installed on each worker on first use.
  • Remote errors — the original Python exception is re-raised on the driver with the worker traceback chained.

The package runs only in the driver Pyodide instance; workers never install it. It is async-first: blocking the driver would starve the event loop the pool lives on.

Usage

import dask
import pyodide_pool

# In JupyterLite: import the JS bundle and start 4 nested workers
pool = await pyodide_pool.create_pool(pool_size=4)

value = await pyodide_pool.submit(fn, *args, **kwargs)  # one remote call
total = await pyodide_pool.compute(dask.delayed(sum)([...]))  # dask collections

create_pool imports the self-contained JS bundle that ships inside the wheel; pass js_url= to load a hosted copy instead. A web app that embeds Pyodide can instead create the JS PyodidePool itself and register it with pyodide.registerJsModule('js_pyodide_pool', { pool }).

Install pyodide-pool[dask] for compute / get.

For the multiprocessing-style API, see wasm-multiprocessing.

Documentation

License

MIT

Metadata

Release files for pyodide-pool 0.2.0

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

Source distribution (sdist)

Source distribution for pyodide-pool 0.2.0
File Size Uploaded Provenance Actions
pyodide_pool-0.2.0.tar.gz 17.8 kB Without provenance Details for pyodide_pool-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyodide-pool 0.2.0
File Interpreter ABI Platform Actions
pyodide_pool-0.2.0-py3-none-any.whl Python 3 none any Details for pyodide_pool-0.2.0-py3-none-any.whl

Total release size: 31.7 kB

Release files / pyodide_pool-0.2.0.tar.gz

Download URL pyodide_pool-0.2.0.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
635a5ea0c669d5258ce4b14466e175204261f635bfdb8ea52b0a3081d377a8be
BLAKE2b-256 checksum
How to use checksums
63bd81f930f47e63d471bc4d76d7aad849db46784dcb8128730b44023da2463e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pyodide_pool-0.2.0-py3-none-any.whl

Download URL pyodide_pool-0.2.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ac2092b3928a34833fcc48f036e010056e4bff73db486ec085db4877b4a3925
BLAKE2b-256 checksum
How to use checksums
63e55409596e2783b7a3bee0cf00440b34c199c0adab6c238fa0934bf2e364d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pyodide-pool 0.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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