• Stars
    star
    845
  • Rank 53,926 (Top 2 %)
  • Language
    Python
  • License
    Other
  • Created over 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Build status PyPI version Python 3.7 License

watermark

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

Sections


Examples

[top]

Using watermark in Jupyter notebooks and IPython sessions

More examples can be found in this Jupyter notebook.

Binder


Using watermark as a module

from watermark import watermark
print(watermark())
Last updated: 2022-09-13T16:28:56.177487-05:00

Python implementation: CPython
Python version       : 3.9.13
IPython version      : 8.4.0

Compiler    : Clang 13.0.1 
OS          : Darwin
Release     : 21.6.0
Machine     : arm64
Processor   : arm
CPU cores   : 10
Architecture: 64bit
print(watermark(packages="numpy,scipy"))
numpy: 1.23.2
scipy: 1.9.1

See help(watermark) for more options.

Installation and updating

[top]

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

Note:

To remove an old watermark installation (installed via the deprecated %install_ext magic extension), simply delete it from the .ipython/extensions/ directory, which is typically located in a user's home directory.

Usage

[top]

After successful installation, the watermark magic extension can be loaded via:

%load_ext watermark

To get an overview of all available commands, type:

%watermark?

  %watermark [-a AUTHOR] [-gu GITHUB_USERNAME] [-e EMAIL] [-ws WEBSITE]
                 [-d] [-n] [-t] [-i] [-z] [-u] [-c CUSTOM_TIME] [-v]
                 [-p PACKAGES] [-co] [-h] [-m] [-g] [-r] [-b] [-w] [-iv]

IPython magic function to print date/time stamps
and various system information.

optional arguments:
  -a AUTHOR, --author AUTHOR
                        prints author name
  -gu GITHUB_USERNAME, --github_username GITHUB_USERNAME
                        prints author github username
  -e EMAIL, --email EMAIL
                        prints author email
  -ws WEBSITE, --website WEBSITE
                        prints author or project website
  -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 in 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
  -co, --conda          prints name of current conda environment
  -h, --hostname        prints the host name
  -m, --machine         prints system and machine info
  -g, --githash         prints current Git commit hash
  -r, --gitrepo         prints current Git remote address
  -b, --gitbranch       prints current Git branch
  -w, --watermark       prints the current version of watermark
  -iv, --iversions      prints the name/version of all imported modules

Development guidelines

[top]

In line with NEP 29, this project supports:

  • All minor versions of Python released 42 months prior to the project, and at minimum the two latest minor versions.

Changelog

[top]

v. 2.4.0 (May 23, 2023)

  • Adds a new --gpu flag to print out GPU information (currently limited to NVIDIA devices) (#90, via contribution by 907Resident)

v. 2.3.1 (May 27, 2022)

v. 2.3.0 (January 3, 2022)

  • Added the following arguments: --github_username - for prints author github username, --email - for prints author email, --website - for prints author or project website. (#82, via contribution by joschkazj)
  • Added a --conda option to print the name of the current conda environment. (#79, via contribution by Alexander Krasnikov)
  • It is now possible to inject globals when used outside IPython (#80, via contribution by Hugo Lapré). For example, version numbers of imported packages can now be obtained as follows:
import numpy
import watermark.watermark as watermark


watermark(iversions=True, globals_=globals())

v. 2.2.0 (February 17, 2021)

  • Refactoring such that a watermark() function now also works outside IPython and Jupyter. Now, the magic %watermark calls watermark(). Calling %watermark via IPython and Juypter still works as usual. However, in addition the watermark() function can be used within regular Python for unit testing purposes etc. (#46, via contribution by Tymoteusz WoÅ‚odźko)

v. 2.1.0 (November 23, 2020)

  • Adopt NEP 29 and require Python version 3.7 or newer. (#63, via contribution by James Myatt)
  • Add Python 3.8 and 3.9 to Travis CI builds. (#63, via contribution by James Myatt)
  • Fix: Allow setup.py to run without install_requires already installed (#67, via contribution by James Myatt)
  • Major refactoring to improve code readability (#64 and 65, via contribution by Bahram Aghaei)
  • Use importlib and importlib.metadata to determine package version numbers. (#66, via contribution by James Myatt)

v. 2.0.2 (November 19, 2019)

  • Support VERSION attributes, in addition to __version__ attributes.

v. 2.0.1 (October 04, 2019)

  • Fix 'sklearn' vs. 'scikit-learn' import compatibility.

v. 2.0.0 (October 04, 2019)

  • Now uses pkg_resources as the default method for getting version numbers.
  • Fixes a whitespace bug when printing the timezone.

v. 1.8.2 (July 28, 2019)

  • When no Python library was imported and the --iversion is used, print an empty string instead of raising an error.

v. 1.8.1 (January 26, 2019)

  • Fixes string alignment issues when the -iv/--iversion flag is used.

v. 1.8.0 (January 02, 2019)

  • The -iv/--iversion flag now also shows package versions that were imported as from X import Y and import X.Y as Y. For example,
import scipy as sp
from sklearn import metrics
import numpy.linalg as linalg
%watermark --iversions

will return

scipy     1.1.0
sklearn   0.20.1
numpy     1.15.4

v. 1.7.0 (October 13, 2018)

(Via contribution by James Myatt)

  • Shows "not installed" for version of packages/modules that cannot be imported.
  • Shows "unknown" for version of packages/modules when version attribute cannot be found.
  • Add Python 3.6 and 3.7 to Travis CI builds.
  • Add classifiers to setuptools configuration.

v. 1.6.1 (June 10, 2018)

  • Now also includes the LICENSE file in the Python Wheels distribution

v. 1.6.0 (Jan uary18, 2018)

  • Adds a new -b/--gitbranch parameter that prints the current Git branch.

v. 1.5.0 (August 27, 2017)

  • Adds a new -iv/ --iversions parameter that prints the package names and version numbers of all packages that were previously imported in the current Python session. (Via contribution by Aziz Alto)

v. 1.4.0 (April 18, 2017)

  • Adds a new -r/ --gitrepo parameter that returns the URL of Git remote name "origin". (Via contribution by Lucy Park)

v. 1.3.4 (October 15, 2016)

  • Allow fetching scikit-learn's version number via -p scikit-learn in addition of -p sklearn (the former is deprecated and will not be supported in watermark > 1.7).

v. 1.3.3 (September 1, 2016)

  • Includes LICENSE in MANIFEST.in for packaging

v. 1.3.2 (August 16, 2016)

  • Fixes an issue where the wrong package info was obtained when using the system level Jupyter within a virtualenv environment. (Via contribrution by Michael Bell)
  • Adds a new -i/ --iso8601 parameter that returns the current date-time string in ISO 8601 format with offset to UTC. For instance: 2016-08-16T18:03:42-04:00. Current caveat: Python < 3.2 requires external libraries for for computing the timezone offset, thus, Python < 3.2 will currently only print 2016-08-16T18:03:42
  • Adds offsets to UTC to the default date-time string for Python >= 3.2

v. 1.3.1 (June 6, 2016)

  • Fixes an issue that caused problems importing watermark using Python 2.x

v. 1.3.0 (May 21, 2016)

  • Removed the deprecated the %install_ext magic so that watermark can now be installed as a regular python package via pip (Via contribution by Peter Bull)

v. 1.2.3 (January 29, 2016)

  • Changed date format to the unambiguous ISO-8601 format
  • Ditched the deprecated %install_ext function and made watermark a proper Python package
  • Released the new version under a more permissive newBSD license

v. 1.2.2 (June 17, 2015)

  • Changed the default date-format of -d, --date to MM/DD/YYYY, the format DD/MM/YYYY can be used via the shortcut -e, --eurodate.

v. 1.2.1 (March 3, 2015)

  • Small bugfix to allow custom time string formatting.

v. 1.2.0 (October 1, 2014)

  • --watermark command added to print the current version of watermark.
  • Print author name on a separate line
  • Fixed bug that day takes the same value as the minute if the -n flag is used.

More Repositories

1

deeplearning-models

A collection of various deep learning architectures, models, and tips
Jupyter Notebook
16,088
star
2

python-machine-learning-book

The "Python Machine Learning (1st edition)" book code repository and info resource
Jupyter Notebook
12,030
star
3

python-machine-learning-book-2nd-edition

The "Python Machine Learning (2nd edition)" book code repository and info resource
Jupyter Notebook
7,021
star
4

mlxtend

A library of extension and helper modules for Python's data analysis and machine learning libraries.
Python
4,631
star
5

python-machine-learning-book-3rd-edition

The "Python Machine Learning (3rd edition)" book code repository
Jupyter Notebook
4,568
star
6

pattern_classification

A collection of tutorials and examples for solving and understanding machine learning and pattern classification tasks
Jupyter Notebook
4,057
star
7

python_reference

Useful functions, tutorials, and other Python-related things
Jupyter Notebook
3,715
star
8

deep-learning-book

Repository for "Introduction to Artificial Neural Networks and Deep Learning: A Practical Guide with Applications in Python"
Jupyter Notebook
2,766
star
9

machine-learning-book

Code Repository for Machine Learning with PyTorch and Scikit-Learn
Jupyter Notebook
2,428
star
10

matplotlib-gallery

Examples of matplotlib codes and plots
Jupyter Notebook
1,135
star
11

machine-learning-notes

Collection of useful machine learning codes and snippets (originally intended for my personal use)
Jupyter Notebook
709
star
12

stat479-machine-learning-fs19

Course material for STAT 479: Machine Learning (FS 2019) taught by Sebastian Raschka at University Wisconsin-Madison
Jupyter Notebook
673
star
13

scipy2023-deeplearning

Jupyter Notebook
597
star
14

pyprind

PyPrind - Python Progress Indicator Utility
Python
545
star
15

stat453-deep-learning-ss20

STAT 453: Intro to Deep Learning @ UW-Madison (Spring 2020)
Jupyter Notebook
537
star
16

stat479-deep-learning-ss19

Course material for STAT 479: Deep Learning (SS 2019) at University Wisconsin-Madison
Jupyter Notebook
493
star
17

algorithms_in_ipython_notebooks

A repository with IPython notebooks of algorithms implemented in Python.
Jupyter Notebook
493
star
18

stat479-machine-learning-fs18

Course material for STAT 479: Machine Learning (FS 2018) at University Wisconsin-Madison
Jupyter Notebook
470
star
19

musicmood

A machine learning approach to classify songs by mood.
OpenEdge ABL
404
star
20

stat453-deep-learning-ss21

STAT 453: Intro to Deep Learning @ UW-Madison (Spring 2021)
Jupyter Notebook
363
star
21

stat451-machine-learning-fs20

STAT 451: Intro to Machine Learning @ UW-Madison (Fall 2020)
Jupyter Notebook
359
star
22

datacollect

A collection of tools to collect and download various data.
Jupyter Notebook
207
star
23

data-science-tutorial

Code material for a data science tutorial
Jupyter Notebook
188
star
24

LLM-finetuning-scripts

Jupyter Notebook
135
star
25

One-Python-benchmark-per-day

An ongoing fun challenge where I'll try to post one Python benchmark per day.
HTML
130
star
26

pydata-chicago2016-ml-tutorial

Machine learning with scikit-learn tutorial at PyData Chicago 2016
Jupyter Notebook
128
star
27

stat451-machine-learning-fs21

Jupyter Notebook
128
star
28

cvpr2023

Python
116
star
29

faster-pytorch-blog

Outlining techniques for improving the training performance of your PyTorch model without compromising its accuracy
Python
115
star
30

msu-datascience-ml-tutorial-2018

Machine learning with Python tutorial at MSU Data Science 2018
Jupyter Notebook
105
star
31

protein-science

A collection of useful tutorials for Protein Science
Python
96
star
32

markdown-toclify

A Python command line tool that creates a Table of Contents for Markdown documents
Python
92
star
33

cyclemoid-pytorch

Cyclemoid implementation for PyTorch
Python
85
star
34

MachineLearning-QandAI-book

Machine Learning Q and AI book
Jupyter Notebook
83
star
35

pydata-annarbor2017-dl-tutorial

Code snippets for "Introduction to Deep Learning with TensorFlow" at PyData Ann Arbor Aug 2017
Jupyter Notebook
80
star
36

smilite

A Python module to retrieve and compare SMILE strings of chemical compounds from the free ZINC online database
Python
73
star
37

pytorch-memory-optim

This code repository contains the code used for my "Optimizing Memory Usage for Training LLMs and Vision Transformers in PyTorch" blog post.
Python
68
star
38

DeepLearning-Gdansk2019-tutorial

Ordinal Regression tutorial for the International Summer School on Deep Learning 2019
Jupyter Notebook
66
star
39

model-eval-article-supplementary

Supplementary material for the article "Model Evaluation, Model Selection, and Algorithm Selection in Machine Learning"
Jupyter Notebook
62
star
40

nn_plus_gzip

Gzip and nearest neighbors for text classification
Jupyter Notebook
58
star
41

LLMs-from-scratch

Implementing ChatGPT-like LLMs from scratch, step by step
Jupyter Notebook
54
star
42

interpretable-ml-article

Code examples for my Interpretable Machine Learning Blog Series
Jupyter Notebook
54
star
43

R_snippets

R Scripts for general data analysis and plotting
R
45
star
44

numpy-intro-blogarticle-2020

Jupyter Notebook for the "Scientific Computing in Python: Introduction to NumPy and Matplotlib" blog article
Jupyter Notebook
40
star
45

blog-finetuning-llama-adapters

Supplementary material for "Understanding Parameter-Efficient Finetuning of Large Language Models: From Prefix Tuning to Adapters"
Jupyter Notebook
36
star
46

mputil

Utility functions for Python's multiprocessing standard library module
Python
35
star
47

pybibtex

Utility functions for parsing BibTeX files and creating citation reference lists.
Python
32
star
48

mytorch

Collection of PyTorch-related utility functions
Python
27
star
49

posit2023-python-ml

Workshop materials for posit::conf(2023)
Jupyter Notebook
25
star
50

comparing-automatic-augmentation-blog

Comparing four automatic image augmentation techniques in PyTorch: AutoAugment, RandAugment, AugMix, and TrivialAugment
Jupyter Notebook
25
star
51

pytorch-fabric-demo

Python
24
star
52

Hbind

Calculates hydrogen-bond interaction tables for protein-small molecule complexes, based on protein PDB and protonated ligand MOL2 structure input. Raschka et al. (2018) J. Computer-Aided Molec. Design
C
24
star
53

scipy2022-talk

Python
23
star
54

gradient-accumulation-blog

Finetuning BLOOM on a single GPU using gradient-accumulation
Python
22
star
55

screenlamp

screenlamp is a Python toolkit for hypothesis-driven virtual screening
Python
22
star
56

2021-issdl-gdansk

Intro to GAN Tutorial for the International Summer School of Deep Learning 2021 in Gdansk
Jupyter Notebook
21
star
57

predicting-activity-by-machine-learning

Activity From Virtual Screening Code Repository
Jupyter Notebook
20
star
58

BondPack

A collection of PyMOL plugins to visualize atomic bonds.
Python
20
star
59

uw-madison-datacience-club-talk-oct2019

Slides and code for the talk at UW-Madison's Data Science Club, 10 Oct 2019
Jupyter Notebook
20
star
60

siteinterlock

A novel approach to pose selection in protein-ligand docking based on graph theory.
Python
19
star
61

low-rank-adaptation-blog

Python
19
star
62

R-notes

Various R lang related material for teaching.
Python
19
star
63

2021-pydata-jeddah

Materials for "Transformers from the Ground Up" at PyData Jeddah on August 5, 2021
Jupyter Notebook
18
star
64

b3-basic-batchsize-benchmark

Experiments for the blog post "No, We Don't Have to Choose Batch Sizes As Powers Of 2"
Python
16
star
65

ViT-finetuning-scripts

Vision transformer finetuning scripts
Python
15
star
66

datapipes-blog

Code for the DataPipes article
Jupyter Notebook
14
star
67

srgan-lightning-blog

Sharing Deep Learning Research Models with Lightning Part 1: Building A Super Resolution App
Python
14
star
68

try-lion-optimizer

Jupyter Notebook
10
star
69

mnist-pngs

MNIST files in PNG format
Python
10
star
70

py-args

Python command line tools as productivity supplements for Posix systems
Python
10
star
71

ecml-teaching-ml-2021

Jupyter Notebook
10
star
72

HbindViz

Tools for generating hydrogen-bond interaction visualizations from Hbind
Python
9
star
73

protein-recognition-index

Protein Recognition Index (PRI), measuring the similarity between H-bonding features in a given complex (predicted or designed) and the characteristic H-bond trends from crystallographic complexes
Python
8
star
74

ord-torchhub

Ordinal Regression PyTorch Hub
Python
6
star
75

compair

Model evaluation utilities
Python
5
star
76

torchmetrics-blog

Code for "TorchMetrics -- How do we use it, and what's the difference between .update() and .forward()"
Jupyter Notebook
5
star
77

rasbt

5
star
78

advent-of-code-2016

My Solutions for the Advent of Code 2016
Python
5
star
79

bugreport

A repository to store code examples to reproduce issues for bug reports.
Jupyter Notebook
2
star
80

bookgiveaway-2022-wordcloud

Word cloud from the results of the book-giveaway
Jupyter Notebook
1
star
81

pycon2024

Tutorial Materials for "The Fundamentals of Modern Deep Learning with PyTorch"
1
star