Skip to main content

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.

Code Quality Upload Python Package
Latest Version GitHub Release Date GitHub commits since latest release (by SemVer including pre-releases) GitHub last commit
GitHub issues GitHub pull requests

Coverage Quality Gate Status Security Rating Maintainability Rating Reliability Rating
Code Smells Duplicated Lines (%) Vulnerabilities Bugs Technical Debt
DeepSource
PyPI

Python Versions
GitHub branch check runs
GitHub branch check runs
GitHub branch check runs
GitHub branch check runs

🚀 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

  1. The Pipeline class takes a list of callable functions as steps
  2. When you call run() with input data, each item is processed through all steps in sequence
  3. If the input is a list, items are processed in parallel using ThreadPoolExecutor
  4. Each step can return a single value or a list of values
  5. 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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polidoro_pipeline-0.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polidoro_pipeline-0.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

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

Hashes for polidoro_pipeline-0.1.tar.gz
Algorithm Hash digest
SHA256 01bd90ad0929ebd5a0ad538f370c689c0dbe0b125e959a98331b67e5277ef77a
MD5 8cadf3719ceffd138bd97594bb01de99
BLAKE2b-256 75942df5db78f37cb06db00081ce2216a4d0ca82363f98bd44fc42626538c277

See more details on using hashes here.

Provenance

The following attestation bundles were made for polidoro_pipeline-0.1.tar.gz:

Publisher: pypi-publish.yml on heitorpolidoro/polidoro-pipeline

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polidoro_pipeline-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for polidoro_pipeline-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bda4d17adafc427786e0249ed4ccb121c88c5165f4021ade123ad18b1edf90eb
MD5 7f3df9ad269c1f28ea28cc0c29ee0c23
BLAKE2b-256 2e6ad9800f34dc4caf18494caf78d97bcdb67908a93a527b7b236362052fb08d

See more details on using hashes here.

Provenance

The following attestation bundles were made for polidoro_pipeline-0.1-py3-none-any.whl:

Publisher: pypi-publish.yml on heitorpolidoro/polidoro-pipeline

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page