or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

core-function.mdindex.mdmagic-extension.md
tile.json

tessl/pypi-watermark

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

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/watermark@2.5.x

To install, run

npx @tessl/cli install tessl/pypi-watermark@2.5.0

index.mddocs/

Watermark

An IPython magic extension that provides comprehensive system information, timestamps, and version tracking capabilities for reproducible research and development workflows. Watermark enables developers to generate detailed watermarks containing date/time stamps, version numbers, and hardware information through both magic commands and programmatic function calls.

Package Information

  • Package Name: watermark
  • Language: Python
  • Installation: pip install watermark
  • GPU Support: pip install "watermark[gpu]"

Core Imports

import watermark
from watermark import watermark

For IPython magic functionality:

%load_ext watermark

Basic Usage

IPython Magic Command

Load the extension and use the magic command:

%load_ext watermark

# Default output with timestamp, Python version, and system info
%watermark

# Show specific information
%watermark -v -m -p numpy,pandas
%watermark -a "Author Name" -d -t
%watermark -iv  # Show all imported package versions

Programmatic Function Usage

Use watermark as a regular Python function:

from watermark import watermark

# Default output
print(watermark())

# Specific information
print(watermark(python=True, machine=True, packages="numpy,pandas"))
print(watermark(author="Author Name", current_date=True, current_time=True))

# Get imported package versions (requires globals)
print(watermark(iversions=True, globals_=globals()))

Architecture

Watermark provides two primary interfaces:

  • Magic Interface: IPython magic command (%watermark) for interactive notebook and IPython session usage
  • Function Interface: Direct function calls (watermark()) for programmatic access and script integration

Both interfaces share the same underlying functionality but use different parameter formats (CLI-style flags vs keyword arguments).

Capabilities

Core Watermark Function

The main watermark functionality that generates formatted output containing system information, timestamps, and version data based on specified parameters.

def watermark(
    author=None,
    email=None, 
    github_username=None,
    website=None,
    current_date=False,
    datename=False,
    current_time=False,
    iso8601=False,
    timezone=False,
    updated=False,
    custom_time=None,
    python=False,
    packages=None,
    conda=False,
    hostname=False,
    machine=False,
    githash=False,
    gitrepo=False,
    gitbranch=False,
    watermark=False,
    iversions=False,
    gpu=False,
    watermark_self=None,
    globals_=None
): ...

Core Function

IPython Magic Extension

IPython magic command interface providing the same functionality through command-line style arguments for interactive usage in notebooks and IPython sessions.

class WaterMark(Magics):
    def watermark(self, line): ...

def load_ipython_extension(ipython): ...

IPython Magic

Types

class PackageNotFoundError(Exception):
    """Custom exception for package not found scenarios."""
    pass