Skip to main content
  1. posts/

Adding execution environment metadata to a Jupyter notebook with 'watermark'

·187 words·1 min· loading · loading · · ·
Tools Data Analysis Python

This is a brief write-up to introduce a delightful tool for Jupyter notebooks, ‘watermark.’

rasbt/watermark

An IPython magic extension for printing date and time stamps, version numbers, and hardware information

Python
908
91

Per the project’s README, ‘watermark’ is “An IPython magic extension for printing date and time stamps, version numbers, and hardware information.” You simply add a couple of lines of code to a Jupyter notebook to automatically include key metadata of it’s execution. Below is an example output (from a notebook exported to Markdown and rendered on GitHub):

Watermark demo

There are various configuration options for the tool (and it can be used as an imported library in the Python session itself), but I personally decided to just find something that works for me and add it as a snippet in Visual Studio Code:

{
 "notebook watermark": {
  "prefix": "watermark",
  "body": [
   "%load_ext watermark",
   "%watermark -d -u -v -iv -b -h -m",
  ],
  "description": "Standard watermark incantation."
 },
 ...
}

‘watermark’ is a simple, focused tool I use in all my Jupyter notebooks. I hope you found this quick post useful and have a very merry Christmas!

Related

Bookshelf Scanner
1086 words·6 mins· loading · loading
Data Science Python Programming ML/AI Data Analysis
How I use Python to organize my data analyses
·2551 words·12 mins· loading · loading
Data Science Data Analysis Python
Dirichlet Regression with PyMC
·1423 words·7 mins· loading · loading
Dev Bayesian PyMC Data Analysis Modeling Statistics Python