A powerful Python library for parallel data processing through a sequence of steps.
Project description
Polidoro Pipeline
A powerful Python library for parallel data processing through a sequence of steps.
| Python Versions |
|---|
🚀 Overview
Polidoro Pipeline is a Python library that simplifies parallel data processing through a sequence of steps. It automatically handles parallelization using Python's ThreadPoolExecutor, making it easy to process both single values and lists of values efficiently.
✨ Features
- 🔄 Process data through a sequence of steps
- ⚡ Automatic parallelization of processing
- 🧩 Simple and intuitive API
- 🔌 Easy to integrate with existing code
- 📦 Handles both single values and lists of values
📋 Installation
pip install polidoro_pipeline
🔧 Usage
Basic Example
from ppipeline import Pipeline
# Define processing steps
def add_1(x):
return x + 1
def multiply_by_2(x):
return x * 2
# Create a pipeline with steps
pipeline = Pipeline([add_1, multiply_by_2])
# Process a single value
result = list(pipeline.run(1)) # [4]
# Process multiple values in parallel
results = list(pipeline.run([1, 2, 3])) # [4, 6, 8]
Adding Steps Incrementally
pipeline = Pipeline()
pipeline.add_step(add_1)
pipeline.add_step(multiply_by_2)
result = list(pipeline.run(2)) # [6]
Controlling Thread Count
# Limit the number of worker threads
pipeline = Pipeline([add_1, multiply_by_2], thread_count=4)
results = list(pipeline.run([1, 2, 3, 4, 5]))
🧠 How It Works
- The Pipeline class takes a list of callable functions as steps
- When you call
run()with input data, each item is processed through all steps in sequence - If the input is a list, items are processed in parallel using ThreadPoolExecutor
- Each step can return a single value or a list of values
- If a step returns multiple values (as a list), each value is processed independently in subsequent steps
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polidoro_pipeline-0.1.tar.gz.
File metadata
- Download URL: polidoro_pipeline-0.1.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01bd90ad0929ebd5a0ad538f370c689c0dbe0b125e959a98331b67e5277ef77a
|
|
| MD5 |
8cadf3719ceffd138bd97594bb01de99
|
|
| BLAKE2b-256 |
75942df5db78f37cb06db00081ce2216a4d0ca82363f98bd44fc42626538c277
|
Provenance
The following attestation bundles were made for polidoro_pipeline-0.1.tar.gz:
Publisher:
pypi-publish.yml on heitorpolidoro/polidoro-pipeline
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polidoro_pipeline-0.1.tar.gz -
Subject digest:
01bd90ad0929ebd5a0ad538f370c689c0dbe0b125e959a98331b67e5277ef77a - Sigstore transparency entry: 340756759
- Sigstore integration time:
-
Permalink:
heitorpolidoro/polidoro-pipeline@8330e774b7ea7176134230b82f04645912183fbf -
Branch / Tag:
refs/tags/0.1 - Owner: https://github.com/heitorpolidoro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@8330e774b7ea7176134230b82f04645912183fbf -
Trigger Event:
release
-
Statement type:
File details
Details for the file polidoro_pipeline-0.1-py3-none-any.whl.
File metadata
- Download URL: polidoro_pipeline-0.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bda4d17adafc427786e0249ed4ccb121c88c5165f4021ade123ad18b1edf90eb
|
|
| MD5 |
7f3df9ad269c1f28ea28cc0c29ee0c23
|
|
| BLAKE2b-256 |
2e6ad9800f34dc4caf18494caf78d97bcdb67908a93a527b7b236362052fb08d
|
Provenance
The following attestation bundles were made for polidoro_pipeline-0.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on heitorpolidoro/polidoro-pipeline
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polidoro_pipeline-0.1-py3-none-any.whl -
Subject digest:
bda4d17adafc427786e0249ed4ccb121c88c5165f4021ade123ad18b1edf90eb - Sigstore transparency entry: 340756815
- Sigstore integration time:
-
Permalink:
heitorpolidoro/polidoro-pipeline@8330e774b7ea7176134230b82f04645912183fbf -
Branch / Tag:
refs/tags/0.1 - Owner: https://github.com/heitorpolidoro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@8330e774b7ea7176134230b82f04645912183fbf -
Trigger Event:
release
-
Statement type: