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)
)

nb = pm.read_notebook("output.ipynb")
result_cell = pm.get_tagged_cell(nb, "results")

rmse = pm.fetch_record(result_cell, "rmse")
plot = pm.get_image_from_cell(result_cell)
print("rmse", rmse)
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.3.tar.gz (22.4 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.3-py2-none-any.whl (8.3 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for papermill-0.3.tar.gz
Algorithm Hash digest
SHA256 5e590c30657001fd63567b671033aee1c6b98d1858b8f2459115a3fed3ed1eb9
MD5 16b38647ca486daeef4a37cf36c82649
BLAKE2b-256 c70dd87daa511b227c949adaecf72d11d9998558634a600cd6ae77dc36853696

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for papermill-0.3-py2-none-any.whl
Algorithm Hash digest
SHA256 370c6ce2c2ed783ab717a53a6166e9ad845b92b0a17e2e36d05e84c6a3ef4479
MD5 f8ef92b96073b35c8e66039d0b86556a
BLAKE2b-256 6ff6a8c48414902dcba0828f5785c49b6543f883ed301ca7d4545639f4ab2660

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