Skip to main content

🔬 Pipe Dreams

Do you want to:

  • Organize your huge pile of loose scripts ?
  • Create neat and reusable python pipelines to process your data or run jobs ?
  • Have a graph (DAG) based parallelization without too much fuss ?
    Well, you are at the right place. Pipe Dreams is a super duper light application programmer interface (API) to support the construction and processing of data pipes for scientific data. It was built primarily for the Laboratory Catalog and Archive System, but now open-ended for other systems.

How do we do it:

  • We use Python Dictionaries to encapsulate all your intermediate results/data flowing through the pipeline, so you can not only declare and run a sequence of functions but also wire the individual output variables to some specific input parameters. What's more, you can rename, merge and exercise other fine grain control over your intermediate results.
  • We provide a Plugin class that can be subclassed to organize your python functions and then call these using their relative string paths in our framework.
  • We use Celery, Redis, and NetworkX to parallelize your workflows with minimal setup on the users part.

🚗 Starting Redis

The Pipe Dreams API requires Redis to run. To start Redis (assuming Docker in installed), run:

$ docker container run \
    --name labcas-redis \
    --publish 6379:6379 \
    --detach \
    redis:6.2.4-alpine

💿 Installing Pipe Dreams

Pipe Dreams is an open source, installable Python packge. It requires Python 3.7 or later. Typically, you'd install it into Python virtual environment, but you can also put it into a Conda or—if you must—your system's Python.

To use a virtual environment, run:

$ python3 -m venv venv
$ venv/bin/pip install --upgrade setuptools pip wheel
$ venv/bin/pip install jpl.pipedreams
$ source venv/bin/activate  # or use activate.csh or activate.fish as needed

Once this is done, you can run venv/bin/python as your Python interpreter and it will have the Pipe Dreams API (and all its dependencies) ready for use. Note that the activate step, although deprecated, is still necessary in order to have the celery program on your execution path.

👉 Note: As of release 1.0.3 of Pipe Dreams, Python 3.7 through Python 3.9 are supported. Python 3.10 is not yet endorsed by this package.

👩‍💻 Customizing the Workflow

The next step is to create a workflow to define the processing steps to publish the data. As an example, see the demo/demo.py which is available from the GitHub release of this package.

In summary you need to

  1. Create an Operation instance.
  2. Add pipes (a sequence of named functions) to the instance.
  3. Run the operation in either single or multi process(es).

📗 Process Your Data Pipes

Finally, with Redis running and a custom workflow defined, you can then execute your pipeline.

As an example, we provide a demonstration workflow and associated test data. You can run it (assuming you've got the virtual Python environment from above) as follows:

$ curl -LO https://github.com/EDRN/jpl.pipedreams/releases/download/v1.0.2/demo.tar.gz | tar xzf -
$ cd demo
$ ../venv/bin/pip install --requirement requirements.txt
$ ../venv/bin/python demo.py
Adding Node: hello_world_read|+|mydata0.txt
…
num nodes in task graph: 7
num task completed: 7
time taken: 0:00:00.NNNNN

That's it 🥳

Metadata

Release files for jpl.pipedreams 1.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 jpl.pipedreams 1.1.0
File Size Uploaded
jpl_pipedreams-1.1.0.tar.gz 35.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jpl.pipedreams 1.1.0
File Interpreter ABI Platform
jpl_pipedreams-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 59.1 kB

Release files / jpl_pipedreams-1.1.0.tar.gz

Download URL jpl_pipedreams-1.1.0.tar.gz
Size 35.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f631137cdadf9a7dd245d5452d7b983cbf8ff5d72655e41d1fc9c67682658068
BLAKE2b-256 checksum
How to use checksums
f30e25dcf7fe8bb57e8cf15cf32b00cf1bf0412b209c05d587ec68ae410d29f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / jpl_pipedreams-1.1.0-py3-none-any.whl

Download URL jpl_pipedreams-1.1.0-py3-none-any.whl
Size 23.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7be0e264190d6d0e89be6b5d4652f8ef366f55f7c13a24daf18b7a752eaa10f
BLAKE2b-256 checksum
How to use checksums
ecbb8766d3862811e3066bae8db1659bbbfee139f00d076188f84e16d2b4b188
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

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