flowpipe.node module

Nodes manipulate incoming data and provide the outgoing data.

class flowpipe.node.FunctionNode(func=None, outputs=None, name=None, identifier=None, metadata=None, graph=None, **kwargs)

Bases: flowpipe.node.INode

Wrap a function into a Node.

RESERVED_INPUT_NAMES = ('func', 'name', 'identifier', 'inputs', 'outputs', 'metadata', 'omit', 'graph')
compute(*args, **kwargs)

Call and return the wrapped function.


Apply the function back to the node.


Pickle the node. – DOES NOT WORK FOR FunctionNode.

class flowpipe.node.INode(name=None, identifier=None, metadata=None, graph='default')

Bases: object

Holds input and output Plugs and a method for computing.

EVENT_TYPES = ['evaluation-omitted', 'evaluation-started', 'evaluation-finished', 'evaluation-exception']

Collate all input plugs and their sub_plugs into one dictionary.


Collate all output plugs and their sub_plugs into one dictionary.

abstract compute(*args, **kwargs)

Implement the data manipulation in the subclass.

Return a dictionary with the outputs from this function.


Connect this node’s outputs to another plug’s input by name.

If other is an InputPlug, connect the output with matching name. If other is an INode, connect all outputs with matching names.

Note: This will also connect up sub-plugs if, and only if, they already exist. As they are dynamically created, they will come into existence only after being referenced explicity at least once. Before, the connect() method will not pick them up.

static deserialize(data)

De-serialize from the given json data.

property downstream_nodes

Nodes connected directly or indirectly to outputs of this Node.


Compute this Node, log it and clean the input Plugs.

Also push a stat report in the following form containing the Node, evaluation time and timestamp the computation started.

static from_json(data)

De-serialize from the given json data.

static from_pickle(data)

De-serialize from the given pickle data.

property is_dirty

Whether any of the input Plug data has changed and is dirty.


List representation of the node showing inputs and their values.

  [i] in: "A"
  [i] in_compound
   [i] in_compound.0: "B"
   [i] in_compound.1 << Node1.out
  [o] compound_out
   [o] in_compound.0: null
   [o] compound_out.1 >> Node2.in, Node3.in
  [o] out >> Node4.in

The node formated into a string looking like a node.

|     Node.Name     |
% compound_in       |
o  compound_in-1    |
o  compound_in-2    |
o in                |
|               out o
|      compound_out %
|   compound_out-1  o
|   compound_out-2  o

Propagate the dirty state to the connected downstream nodes.


Perform more data operations after initial serialization.


Serialize the node to json.

Deprecated and kept for backwards compatibility.


Serialize the node to json.


Serialize the node into a pickle.

property upstream_nodes

Nodes connected directly or indirectly to inputs of this Node.

flowpipe.node.Node(*args, **kwargs)

Wrap the given function into a Node.