#!/usr/bin/env python
# coding: utf-8
# [Sebastian Raschka](http://sebastianraschka.com)
#
# - [Link to the GitHub Repository python_reference](https://github.com/rasbt/python_reference/)
#
#
# I would be happy to hear your comments and suggestions.
# Please feel free to drop me a note via
# [twitter](https://twitter.com/rasbt), [email](mailto:bluewoodtree@gmail.com), or [google+](https://plus.google.com/+SebastianRaschka).
#
# ### watermark is now located and maintained in a separate GitHub repository: [https://github.com/rasbt/watermark](https://github.com/rasbt/watermark)
# # IPython magic function documentation - `%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](https://github.com/rasbt/One-Python-benchmark-per-day) series.
#
#
#
# ## Installation
# The `watermark` line magic can be directly installed from my GitHub repository via
# In[1]:
install_ext https://raw.githubusercontent.com/rasbt/watermark/master/watermark.py
#
#
# ## Loading the `%watermark` magic
# To load the `date` magic, execute the following line in your IPython notebook or current IPython shell
# In[2]:
get_ipython().run_line_magic('load_ext', 'watermark')
#
#
# ## Usage
# In order to display the optional `watermark` arguments, type
# In[12]:
get_ipython().run_line_magic('pinfo', '%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
#
#
#
# ## Examples
# In[4]:
get_ipython().run_line_magic('watermark', '')
#
# In[5]:
get_ipython().run_line_magic('watermark', '-d -t')
#
# In[6]:
get_ipython().run_line_magic('watermark', '-u -n -t -z')
#
# In[7]:
get_ipython().run_line_magic('watermark', '-v')
#
# In[8]:
get_ipython().run_line_magic('watermark', '-m')
#
# In[9]:
get_ipython().run_line_magic('watermark', '-v -m -p numpy,scipy')
#
# In[10]:
get_ipython().run_line_magic('watermark', '-a "John Doe" -d -v -m -g')
#
# In[ ]: