Skip to main content

A lightweight, object-orientated pipeline framework in Python

Project description

Pipelining

A lightweight, object-orientated pipeline framework in Python, with Rich-powered logging, and abstract semantics.

Features

  • Modular Stages: Each processing step can be defined by subclassing the simple Stage interface.
  • Pipeline Orchestration: Stages can be composed into ordered pipelines with automatic logging injection.
  • Pretty Logging: Good looking logging, powered by Rich

Installation

Coming soon.

Example

class TextStage(Stage):
    def __init__(self, name: str, message: str) -> None:
        super().__init__(name)
        self.message = message

    def run(self, context: dict[str, Any]) -> None:
        self.logger.info(f"{self.name}: {self.message}")


pipeline = Pipeline(
    [TextStage("Stage 1", "Hello, World!"), TextStage("Stage 2", "Goodbye, World!")],
    name="Example Pipeline",
)

pipeline.run()

A simple example like this will output:

[2025-05-07 17:52:18] INFO     Starting Example Pipeline                                                                                                                           
                      INFO     Running stage: TextStage                                                                                                                            
                      INFO     Stage 1: Hello, World!                                                                                                                              
                      INFO     Stage TextStage completed successfully!                                                                                                             
                      INFO     Running stage: TextStage                                                                                                                            
                      INFO     Stage 2: Goodbye, World!                                                                                                                            
                      INFO     Stage TextStage completed successfully!                                                                                                             
                      INFO     Example Pipeline completed successfully!                                                                                                            

Development

To setup a Python environment for this project, I recommend using Pixi - I use it and like it. You can enter the workspace using:

$ pixi shell
...

The following self-explanatory tasks are available for usage.

  • ruff
  • mypy
  • test
  • coverage

Testing

Tests can be run through Pixi with:

$ pixi run test
...

They can be run with coverage too, this will generate a coverage report under the htmlcov directory.

$ pixi run coverage
...

Contributing

Feel free to contribute to the project! I would appreciate any feedback or comments. Although this project has been built with my own usage in mind, I'm open to changes and improvements.

Project details


Download files

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

Source Distribution

pipelining_colemann-0.0.1.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

pipelining_colemann-0.0.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file pipelining_colemann-0.0.1.tar.gz.

File metadata

  • Download URL: pipelining_colemann-0.0.1.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pipelining_colemann-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a1b5aeff20cd070499a5d5f8149932313062bbf8b6fd79499a7f4e7ec503a64b
MD5 b6ad8cdcf2034d6eed6d368d2f96b051
BLAKE2b-256 de7ee9410232ef2b8b639870fe5e34d82f4696d27cf2caad9e1f63629ab43420

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipelining_colemann-0.0.1.tar.gz:

Publisher: publishing.yml on colemannoah/pipelining

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

File details

Details for the file pipelining_colemann-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pipelining_colemann-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 21675fb434d63912a772f8217147ec8d2b0515fbf4d894cdab5c25ae249fdede
MD5 16031e76833bcf9952daf4f7e802724f
BLAKE2b-256 f5226a9a444f00ce31218de7629e8c16338831c50789afcc61fa2bb75d42296a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipelining_colemann-0.0.1-py3-none-any.whl:

Publisher: publishing.yml on colemannoah/pipelining

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