%watermark
¶I wrote this simple watermark
IPython magic function to conveniently add date- and time-stamps to my IPython notebooks. Also, I often want to document various system information, e.g., for my Python benchmarks series.
The watermark
line magic can be directly installed from my GitHub repository via
install_ext https://raw.githubusercontent.com/rasbt/watermark/master/watermark.py
Installed watermark.py. To use it, type: %load_ext watermark
%watermark
magic¶To load the date
magic, execute the following line in your IPython notebook or current IPython shell
%load_ext watermark
In order to display the optional watermark
arguments, type
%watermark?
%watermark [-a AUTHOR] [-d] [-e] [-n] [-t] [-z] [-u] [-c CUSTOM_TIME] [-v] [-p PACKAGES] [-h] [-m] [-g] [-w] IPython magic function to print date/time stamps and various system information. watermark version 1.2.1 optional arguments: -a AUTHOR, --author AUTHOR prints author name -d, --date prints current date as MM/DD/YYYY -e, --eurodate prints current date as DD/MM/YYYY -n, --datename prints date with abbrv. day and month names -t, --time prints current time -z, --timezone appends the local time zone -u, --updated appends a string "Last updated: " -c CUSTOM_TIME, --custom_time CUSTOM_TIME prints a valid strftime() string -v, --python prints Python and IPython version -p PACKAGES, --packages PACKAGES prints versions of specified Python modules and packages -h, --hostname prints the host name -m, --machine prints system and machine info -g, --githash prints current Git commit hash -w, --watermark prints the current version of watermark File: ~/.ipython/extensions/watermark.py
%watermark
06/29/2015 15:34:42 CPython 3.4.3 IPython 3.2.0 compiler : GCC 4.2.1 (Apple Inc. build 5577) system : Darwin release : 14.3.0 machine : x86_64 processor : i386 CPU cores : 4 interpreter: 64bit
%watermark -d -t
06/29/2015 15:34:43
%watermark -u -n -t -z
Last updated: Mon Jun 29 2015 15:34:44 EDT
%watermark -v
CPython 3.4.3 IPython 3.2.0
%watermark -m
compiler : GCC 4.2.1 (Apple Inc. build 5577) system : Darwin release : 14.3.0 machine : x86_64 processor : i386 CPU cores : 4 interpreter: 64bit
%watermark -v -m -p numpy,scipy
CPython 3.4.3 IPython 3.2.0 numpy 1.9.2 scipy 0.15.1 compiler : GCC 4.2.1 (Apple Inc. build 5577) system : Darwin release : 14.3.0 machine : x86_64 processor : i386 CPU cores : 4 interpreter: 64bit
%watermark -a "John Doe" -d -v -m -g
John Doe 06/29/2015 CPython 3.4.3 IPython 3.2.0 compiler : GCC 4.2.1 (Apple Inc. build 5577) system : Darwin release : 14.3.0 machine : x86_64 processor : i386 CPU cores : 4 interpreter: 64bit Git hash : 06830b939358f35f2daf50af42509e603c93d9b4