pyrlang.notebook module

class pyrlang.notebook.Notebook(options: dict)

Bases: pyrlang.gen.server.GenServer

Implements a flow for performing remote calculations from Erlang on Python node, while storing the results on Python side until they are ready. Each call result is stored in notebook history and a value index is returned to the caller. This index can be used as an argument in subsequent calls.

async handle_exit_call(**kwargs)
history_ = None

Recent calculation results indexed by integers or names.

history_ids_ = None

Log of recent value ids in their creation order. Values, which were deleted because of history size limit, are also deleted here.

history_limit_ = None

History dict will be trimmed when its length is greater than this limit to save memory. Attempt to refer to a trimmed value will create value_not_found exception, also propagated to Erlang side.

async nb_batch(**kwargs)
async nb_call(**kwargs)
async nb_retrieve(**kwargs)
value_id_ = None

Next id to be used as result index.

pyrlang.notebook.call(name, msg_len=2)

specific decorator function

Handle the decorator where we expect a tuple of a specific size and the first item being an atom with specific name

pyrlang.notebook.new_context(options: dict) → term.pid.Pid

Create a new remote-call notebook context. Node_name argument will be automatically prepended to args by Rex.