Skip to main content

mempipe

This package combines the simplicity of using Python's multiprocessing.Pipe() with the speed of multiprocessing.shared_memory.SharedMemory. Meant for a multiprocessing data analysis pipeline where each process analyses the data and passes it to the next process for the next step.

The passed data can only be a numpy array.

Originally designed for a real-time Brain-Computer-Interface application.

Install

Using uv:

uv sync         # set up the environment
uv run pytest   # run the tests

How to use

Import the MemPipe class. Make an instance object. Call YourMemPipeInstance.Pipe(ex_array) instead of the multiprocessing.Pipe(duplex=False) in your applicaiton. The ex_array is a numpy array that is used to infer the dtype and the size of the shared memory. It must be the biggest array size that you will intend to pass between the processes. If you .send() larger numpy arrays, they will be truncated to ex_array.shape. If you .send() smaller numpy arrays, they will be handled just fine.

The pipe objects support poll(), recv(), and send(). Before calling recv(), you must call poll() and make sure it returns True (as you would normally).

All else is handled internally.
Currently, ./tests/test2.py shows an example using the latest API.

Simulation

This was done using an older version of the package

My simple simulation (found here: ./tests/test3.py) shows that passing a numpy array of $12000 \times 4000$ is much faster this way, compared to regular pipes.

a figure
20 repeatitions on the x-axis, and the execution time on the y-axis.

Metadata

Release files for mempipe 0.3.2

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

Source distribution (sdist)

Source distribution for mempipe 0.3.2
File Size Uploaded Provenance
mempipe-0.3.2.tar.gz 92.3 kB With provenance Details

Built distribution (wheel)

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

Total release size: 121.0 kB

Release files / mempipe-0.3.2.tar.gz

Download URL mempipe-0.3.2.tar.gz
Size 92.3 kB
Tags Source
SHA-256 checksum
How to use checksums
96c7569d217c7e6299a841bbb8c1ccb31dd6d2ab094d6a3980a265cb6cb659ef
BLAKE2b-256 checksum
How to use checksums
894e30aca43c7bb7913525f9b9a8c0d12edc5deb13494f4f7bda565fcb84ecb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 19, 2026.

Transparency log

Release files / mempipe-0.3.2-py3-none-any.whl

Download URL mempipe-0.3.2-py3-none-any.whl
Size 28.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab2df272bc38f5d4b16f5b8885a438861d4c62a7ba5d0af0cb61dec6e1669f22
BLAKE2b-256 checksum
How to use checksums
8f87e532ac909e5ecfbded14bd5d60e132375cfae3b4c7f635e95a8719553e5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 19, 2026.

Transparency log

Security for mempipe 0.3.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mempipe-0.3.2.tar.gz

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 Jun 19, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files Full provenance

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