HdiJupyterUtils: Utils for Jupyter projects from HDInsight team

0.23.0 · active · verified Sat Apr 11

HdiJupyterUtils is a Python library providing utilities for Jupyter projects, particularly those from the HDInsight team, often used in conjunction with Sparkmagic for interactive Spark cluster interaction. It is currently at version 0.23.0 and sees active development with regular patch and minor releases as part of the Sparkmagic project.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use the `display_html` function from `hdijupyterutils.ipythondisplay` to render raw HTML content, including the HTML representation of a Pandas DataFrame, directly in a Jupyter environment. This function is often used internally by Sparkmagic to present results.

from hdijupyterutils.ipythondisplay import display_html
import pandas as pd

# Displaying a simple HTML string
html_message = "<h2>Hello from HdiJupyterUtils!</h2><p>This utility aids in Jupyter/HDInsight interactions.</p>"
display_html(html_message, raw=True)

# Example of displaying a Pandas DataFrame as HTML using the utility
data = {"Name": ["Alice", "Bob"], "Age": [25, 30]}
df = pd.DataFrame(data)
display_html(df.to_html(), raw=True)

view raw JSON →