semvec/pypi-packages huggingface dataset:
pipekit 0.3.5
Tools for flow-based programming
Keywords: etl workflow flow-based pipe pipeline queue data processing

Pipekit
=======

Pipekit_ is a flow-based_ programming toolkit, with a control layer.

.. _Pipekit: https://github.com/ncadou/pipekit
.. _flow-based: https://en.wikipedia.org/wiki/Flow-based_programming


Quick start
===========

Pipekit connects message processors using pipes. Pipes are just a thin layer on
top of Queue_ objects and 0mq_ sockets, wrapping them under a common API. The
basic idea behind this abstraction is the possibility to transparently replace
a pipe implementation with another one, with no code change needed in the
producers/consumers.

Pipes simply have an input and an output channel; creating and using them is
pretty straightforward:

.. code:: python

    from pipekit import ThreadPipe

    # Pipes need to be given a name
    mypipe = ThreadPipe('my-pipe')
    mypipe.send('Hello world')

    print(mypipe.receive())
    # Hello world

Pipes are iterables, too:

.. code:: python

    for msg in mypipe:
        dosomething(msg)

Need a 0mq-based pipe instead?

.. code:: python

    from pipekit import ZMQPipe

    my0mqpipe = ZMQPipe('my-0mq-pipe', address='tcp://*:5555')

Alternatively:

.. code:: python

    from pipekit import Pipe

    my0mqpipe = Pipe('my-0mq-pipe', impl='zmq', address='tcp://*:5555')
    print(my0mqpipe)
    # <pipekit.ZMQPipe object at 0x7fe...>

.. _Queue: https://docs.python.org/3/library/queue.html
.. _0mq: http://zeromq.org/
wraperr 1.0.2
Define exception handling logic via a decorator.
Requires Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4

# WrapErr

The goal of WrapErr is to avoid contaminating main logic with try-catch blocks and the exception handling logic.

Without WrapErr, you have something like this:

```python
try:
    // do something
except Exception as e:
    // exception handling logic
```

With WrapErr, you would write something more like this:

```python
def error_handler(e: Exception):
    // exception handling logic

@wrap_error(error_handler)
def foo(*args, **kwargs):
    // do something
```

You can reuse the same error handling logic across multiple functions and methods:

```python
def error_handler(e: Exception):
    // exception handling logic

@wrap_error(error_handler)
def foo(*args, **kwargs):
    // do something

@wrap_error(error_handler):
def bar(*args, **kwargs):
    // do something else
```

You can also only handle exceptions of a specific type:

```python
def value_error_handler(e: ValueError):
    // exception handling logic

@wrap_error(error_handler, ValueError)
def foo(*args, **kwargs):
    // do something
```

And you can combine different error handlers that handle different exceptions:

```python
def value_error_handler(e: ValueError):
    // exception handling logic

def attribute_error_handler(e: AttributeError):
    // more exception handling logic

@wrap_error(value_error_handler, ValueError)
@wrap_error(attribute_error_handler, AttributeError)
def foo(*args, **kwargs):
    // do something
```