A powerful Python package for connecting and orchestrating multiple data pipelines
Project description
Pipeline Connector
A powerful Python package for connecting and orchestrating multiple data pipelines with ease.
Features
- Multi-Pipeline Connection: Connect 2 or more pipelines seamlessly
- Data Flow Management: Intelligent data routing between connected pipelines
- Asynchronous Support: Built-in async support for high-performance processing
- Type Safety: Full type hints and Pydantic validation
- Extensible Architecture: Easy to extend with custom pipeline implementations
- Error Handling: Robust error handling and recovery mechanisms
- Logging: Comprehensive logging for debugging and monitoring
Installation
pip install pipeline-connector
Quick Start
from pipeline_connector import PipelineManager, DataPipeline
# Create pipeline instances
pipeline1 = DataPipeline("data_source")
pipeline2 = DataPipeline("data_processor")
pipeline3 = DataPipeline("data_sink")
# Create a pipeline manager
manager = PipelineManager()
# Connect pipelines
manager.connect(pipeline1, pipeline2)
manager.connect(pipeline2, pipeline3)
# Execute the connected pipelines
result = await manager.execute(input_data)
Advanced Usage
Custom Pipeline Implementation
from pipeline_connector import BasePipeline
from typing import Any, Dict
class CustomDataProcessor(BasePipeline):
async def process(self, data: Any) -> Any:
# Your custom processing logic
processed_data = self.transform(data)
return processed_data
def transform(self, data: Any) -> Any:
# Implement your transformation logic
return data
Pipeline with Configuration
from pipeline_connector import PipelineManager, PipelineConfig
config = PipelineConfig(
name="my_pipeline",
batch_size=100,
timeout=30,
retry_attempts=3
)
manager = PipelineManager(config=config)
Error Handling
from pipeline_connector import PipelineManager, PipelineError
try:
result = await manager.execute(data)
except PipelineError as e:
print(f"Pipeline error: {e}")
# Handle the error appropriately
API Reference
PipelineManager
The main class for managing and connecting multiple pipelines.
Methods
connect(source_pipeline, target_pipeline): Connect two pipelinesdisconnect(source_pipeline, target_pipeline): Disconnect pipelinesexecute(data, **kwargs): Execute the connected pipeline chainget_connections(): Get all current pipeline connections
BasePipeline
Abstract base class for creating custom pipelines.
Methods
process(data): Abstract method to implement data processing logicvalidate_input(data): Validate input datavalidate_output(data): Validate output data
DataPipeline
Ready-to-use pipeline implementation for common data processing tasks.
Examples
Check out the examples/ directory for more detailed usage examples:
basic_usage.py: Simple pipeline connection exampleasync_processing.py: Asynchronous pipeline processingcustom_pipeline.py: Creating custom pipeline implementationserror_handling.py: Error handling and recovery
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
Version 0.1.0
- Initial release
- Basic pipeline connection functionality
- Asynchronous support
- Type safety with Pydantic
- Comprehensive error handling
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 pipeline_connector-0.1.0.tar.gz.
File metadata
- Download URL: pipeline_connector-0.1.0.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bbb0b7e81116cd2a3bc6e00694a878b2f4ca701da9a90007ae871905d20e1b1
|
|
| MD5 |
2b7bfa6d3513fb06805660354dbf3928
|
|
| BLAKE2b-256 |
0478bf30f06847b6bdde9a18a1a2722328d648d8037c622ee2877e23437c8d55
|
File details
Details for the file pipeline_connector-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pipeline_connector-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36558fbb6f58575f97f372f963620bc4520ea583e41ba237a1afea631ae8effc
|
|
| MD5 |
00391ac468d0f9c1ca385122bff5d463
|
|
| BLAKE2b-256 |
12215f6f37e870a5537ef60d76190fad7c3ea8e7dd928187cbc8bae1fa6d3185
|