%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 installed by executing
pip install watermark
Alternatively, you can install the latest development version directly from GitHub via
pip install -e git+https://github.com/rasbt/watermark#egg=watermark
%watermark
magic¶To load the watermark
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] [-n] [-t] [-i] [-z] [-u] [-c CUSTOM_TIME] [-v] [-p PACKAGES] [-h] [-m] [-g] [-w] IPython magic function to print date/time stamps and various system information. optional arguments: -a AUTHOR, --author AUTHOR prints author name -d, --date prints current date as YYYY-mm-dd -n, --datename prints date with abbrv. day and month names -t, --time prints current time as HH-MM-SS -i, --iso8601 prints the combined date and time including the time zone the ISO 8601 standard with UTC offset -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
%watermark
2016-08-16T18:03:25-04:00 CPython 3.5.1 IPython 5.0.0 compiler : GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28) system : Darwin release : 15.6.0 machine : x86_64 processor : i386 CPU cores : 4 interpreter: 64bit
%watermark -t -d
2016-08-16 18:03:31
%watermark --iso8601
2016-08-16T18:03:42-04:00
%watermark -u -n -t -z
last updated: Tue Aug 16 2016 18:03:47 EDT
%watermark -v
CPython 3.5.1 IPython 5.0.0
%watermark -m
compiler : GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28) system : Darwin release : 15.6.0 machine : x86_64 processor : i386 CPU cores : 4 interpreter: 64bit
%watermark -v -m -p numpy,scipy -g
CPython 3.5.1 IPython 5.0.0 numpy 1.11.1 scipy 0.17.1 compiler : GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28) system : Darwin release : 15.6.0 machine : x86_64 processor : i386 CPU cores : 4 interpreter: 64bit Git hash : fbeb63abe159172529542e202a8c92ec3227099d
%watermark -a "John Doe" -d -v -m
John Doe 2016-08-16 CPython 3.5.1 IPython 5.0.0 compiler : GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28) system : Darwin release : 15.6.0 machine : x86_64 processor : i386 CPU cores : 4 interpreter: 64bit
import numpy as np
import scipy as sp
%watermark --iversions
numpy 1.12.1 scipy 0.19.1