Skip to main content

Map Reduce for Notebooks

Project description

Papermill is map reduce for Jupyter notebooks.

Stepping away from the hyperbole, our goals for Papermill include simplifying and streamlining:

  • Parametrizing notebooks

  • Executing and collecting metrics across the notebooks

  • Summarize collections of notebooks

Installation

pip install papermill

Usage

Executing a parametrized notebook

import papermill as pm

pm.execute_notebook(
    notebook="template.ipynb",
    output="output.ipynb",
    params=dict(alpha=0.1, ratio=0.001)
)

nb = pm.read_notebook("output.ipynb")

Creating a parametrized notebook and record metrics

### template.ipynb
import papermill as pm

rmse = metrics.mean_squared_error(...)
pm.record_value("rmse", rmse)
plot() # Tag this cell as "results" for extraction later
### run_and_summarize.ipynb
pm.execute_notebook(
    notebook="template.ipynb",
    output="output.ipynb",
    params=dict(alpha=0.1, ratio=0.001)
)

# Print RMSE value saved in "output.ipynb"
nb = pm.read_notebook("output.ipynb")
nb_data = pm.fetch_notebook_data(nb)
print("rmse", nb_data["rmse"])

# Show plot found in "output.ipynb"
result_cell = pm.get_tagged_cell(nb, "results")
plot = pm.get_image_from_cell(result_cell)
pm.display_image(plot)

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

papermill-0.4.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

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

papermill-0.4-py2-none-any.whl (8.7 kB view details)

Uploaded Python 2

File details

Details for the file papermill-0.4.tar.gz.

File metadata

  • Download URL: papermill-0.4.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for papermill-0.4.tar.gz
Algorithm Hash digest
SHA256 6979e96b195a463d7fd6a85159f98b494a65b2c1ea6bb68c922d790252f7aa75
MD5 29ceb0c3dcaaa1fa3bbcbcbe2131bfce
BLAKE2b-256 0827ccfc864038ec0832d99d72e646088ee77a3eeb9cb8b4bc10147fef00c3ad

See more details on using hashes here.

File details

Details for the file papermill-0.4-py2-none-any.whl.

File metadata

File hashes

Hashes for papermill-0.4-py2-none-any.whl
Algorithm Hash digest
SHA256 574eab133ff71edc07154b84021be686523a9aacf61ac63da0c65c0bd8b7d52a
MD5 c225c9ded2cb829543c06bc0ab5c926b
BLAKE2b-256 e151cb854696478dd45addc4e2e136b8c97cf05d56e1befde13637c94c202ba4

See more details on using hashes here.

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