sidgarimella
conveyor
Jupyter Notebook

A set of tools to accelerate work in Jupyter notebooks.

Last updated May 15, 2020
11
Stars
0
Forks
0
Issues
0
Stars/day
Attention Score
0
Language breakdown
Jupyter Notebook 89.7%
Python 10.3%
Files click to expand
README

Conveyor

Build Status

Compute and use Jupyter notebook cell outputs in other notebooks and scripts with just a couple lines of code.

Use Cases

- Split ordered steps across multiple notebooks, picking up the most recent state information with each new notebook - Prototype and organize workflows entirely in Jupyter notebooks without having to manage script exports - Improve performance by reducing overheads from notebook servers and unused code cells

Requirements

Conveyor currently only supports Jupyter notebooks written in Python. It is important to ensure that you have the version of Python (and any dependencies) used in your notebooks also installed locally, or on the machine using this library.

Examples

For quick and simple access to values in a prior notebook:

conveyor.runnotebook("conveyor/examples/Sample Calculations I.ipynb", importglobals=True)

all notebook globals pushed to conveyor.nbglobals with import_globals flag

from conveyor.nbglobals import x, y, z, fig

print(y)

Conveyor can also provide you with any information available in a prior Jupyter workspace.

results = conveyor.run_notebook("conveyor/examples/tests/Sample Calculations I.ipynb")

Cells are zero-indexed, only code cells are counted

codecellidx = 1

Get a cell's source code

code = results[codecellidx]['code']

Get a cell result

cellresult = results[codecell_idx]['result']

Get cell stdout

cellstdout = results[codecell_idx]['stdout']

To get any variable available in notebook

x = results.getvar('x')

There are options for running notebooks that can be used to optimize notebook execution, or stitch notebooks together in pipelines.

from conveyor.multinb import Pipeline
...
data_processing = Pipeline()

The variable 'df' from load_data.ipynb will replace 'df' in

process_data.ipynb, starting from the third code cell.

dataprocessing.addnotebook(filename="conveyor/examples/tests/loaddata.ipynb", carryvars=['df']) dataprocessing.addnotebook(filename="conveyor/examples/tests/process_data.ipynb", carryvars=['magicnumber'], startcellidx=3)

Add custom intermediary steps

def transformmagic(fromstate): to_state = dict() tostate['transformedmagicnumber'] = -1 * fromstate['magic_number'] return to_state

dataprocessing.addtransform(transform_magic)

Get output of selected variables from each stage

results = data_processing.run()

Installation

This package is available on pypi. Install it using pip with

pip install jupyter-conveyor

Conveyor is only compatible with Python versions > 3.5.

Documentation

See the docs folder, or read them here.

🔗 More in this category

© 2026 GitRepoTrend · sidgarimella/conveyor · Updated daily from GitHub