Skip to main content

minpipe

minpipe is a minimal library for building one-off concurrent data pipelines in python. It was inspired by pypeln.

Example

import numpy as np
from minpipe import Pipeline, Signal, Stage

def make_random_data():
    x = np.random.randn(10, 10, 10000)

    def random_data():
        for xi in x:
            yield xi
        yield Signal.STOP

    return random_data

def mean(xi):
    yield np.mean(xi, axis=-1)

def flatten(means):
    for m in means:
        yield m

def filter_pos(m):
    if m > 0:
        yield m

def printout(m):
    print(f"mean={m:.2f}")

pipeline = Pipeline(
    Stage(make_random_data()),
    Stage(mean, num_workers=2),
    Stage(flatten, num_workers=1),
    Stage(filter_pos),
    Stage(printout),
)

# serial debug run
# pipeline.serial(max_items=10)

pipeline.start()
pipeline.join()

Installation

pip install minpipe

See also

Licence

MIT

Metadata

Release files for minpipe 0.1.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 minpipe 0.1.0
File Size Uploaded Provenance Actions
minpipe-0.1.0.tar.gz 4.7 kB Without provenance Details for minpipe-0.1.0.tar.gz

Release files / minpipe-0.1.0.tar.gz

Download URL minpipe-0.1.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
07df6e7ca4dfef74e0f7d904f67a3e32ae4ecde5e3d8b327c252a74c74b3a4a2
BLAKE2b-256 checksum
How to use checksums
44323ee148bca06dba5d6e809184e7e9d64afbc09b67ed979e0a16b817abd861
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.4 tqdm/4.59.0 importlib-metadata/3.10.0 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.7.10

Security for minpipe 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No 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