Introduction
Machine learning engineers and data scientists constantly need to visualize, analyze, and share the results of their experiments. While Jupyter notebooks are excellent for exploration, sharing them often results in a non-interactive, static report. Full-fledged web frameworks like Streamlit are powerful but can be overkill for simply sharing a set of charts. This is the gap that Tessera, a Python library with over 280 GitHub stars, aims to fill. It provides a simple, code-first way to build beautiful, dynamic, and fully interactive dashboards that can be exported as a single, self-contained HTML file.
What Is Tessera?
Tessera is a Python library that allows developers to create beautiful, dynamic, and shareable dashboards for machine learning experiments and data analysis pipelines. Built by zengxiao-he using Python, React, and TypeScript, it offers a programmatic and reproducible way to define complex data visualizations. Instead of a graphical drag-and-drop interface, you define your dashboard’s layout and content directly in Python code, making it easy to version control and integrate into your existing data workflows.
The core feature that sets Tessera apart is its output: a single, self-contained HTML file. This file bundles all the necessary data, interactive components, and logic, allowing anyone to open and interact with the full dashboard in a web browser without needing to run a Python server. Released under the permissive MIT license, Tessera is a free and open-source tool for anyone needing to create polished, interactive data stories.
Why Tessera Matters
Tessera matters because it occupies a valuable niche between the complexity of full web application frameworks and the static nature of traditional reporting tools. Before tools like Tessera, a data scientist had limited options for sharing interactive results. They could send a messy Jupyter notebook, which requires the recipient to have the same environment set up. They could build a full web app using Streamlit or Dash, which is time-consuming and requires a live server for hosting. Or, they could resort to sending static screenshots, losing all interactivity.
Tessera provides a ‘just right’ solution. It delivers the rich interactivity of a modern web application but with the simplicity and portability of a single file. This is a game-changer for collaboration. You can now email a dashboard, post it on an internal wiki, or simply host it as a static asset. This approach democratizes access to data insights, allowing non-technical stakeholders to explore results, zoom in on charts, and filter tables without any technical overhead.
Key Features
- Code-First Definition: Dashboards are defined entirely in Python. This makes them reproducible, version-controllable with Git, and easy to generate programmatically as part of a larger data pipeline.
- Interactive Components: Tessera comes with a set of pre-built, high-quality interactive components. This includes line charts, scatter plots, bar charts, and tables, all of which support interactions like zooming, panning, and hovering to see data points.
- Composable Layouts: You can create sophisticated dashboard layouts using simple horizontal (
HStack) and vertical (VStack) stacking components. This allows you to arrange multiple charts, tables, and text blocks into a clean, professional-looking design. - Self-Contained HTML Export: The flagship feature is the ability to export the entire dashboard—data and all—into a single HTML file. This file has zero external dependencies and can be opened in any modern browser for a fully interactive experience.
- Pandas DataFrame Integration: The library is designed for the Python data science ecosystem. All chart and table components seamlessly accept pandas DataFrames as their data source, fitting perfectly into existing workflows.
- Modern Tech Stack: By leveraging React and TypeScript for the frontend components, Tessera provides a smooth and responsive user experience that feels like a dedicated web application, not a simple static plot.
How Tessera Compares
Tessera’s unique approach to dashboarding places it in a distinct position relative to other popular data visualization tools in the Python ecosystem. Its primary strength lies in its export format and ease of use for a specific set of tasks.
| Feature | Tessera | Streamlit / Dash | Jupyter Notebook | TensorBoard |
|---|---|---|---|---|
| Primary Output | Interactive Single HTML File | Live Web Application | .ipynb file / Static HTML | Live Web Application |
| Deployment | Static file hosting (or email) | Requires a Python server | Requires Jupyter server for interactivity | Requires a Python server |
| Ease of Use | High (Simple, declarative API) | Medium (More complex state management) | High (For exploration) | High (For logging standard metrics) |
| Use Case | Sharing interactive reports & experiment results | Building complex data apps with callbacks | Exploratory data analysis & research | Logging & visualizing deep learning metrics |
Tessera is not a direct replacement for Streamlit or Dash. Those frameworks are far more powerful for building full-fledged data applications with complex logic, user inputs, and callbacks. However, this power comes with the complexity of managing a web server. Tessera’s sweet spot is the ‘snapshot’ dashboard—a detailed, interactive report of a specific analysis or experiment run that needs to be shared widely and easily.
Compared to a Jupyter Notebook, Tessera provides a much more polished and professional output. While notebooks are unbeatable for exploration, their exported HTML is often static and cluttered with code cells. Tessera creates a clean, presentation-ready artifact designed for an audience, not just the analyst. It is also more flexible than TensorBoard, which is purpose-built for visualizing model training metrics but is less suited for general-purpose data analysis or creating custom layouts with diverse data sources.
Getting Started: Installation
Getting started with Tessera is as simple as installing it from PyPI using pip.
Prerequisites
- Python 3.7 or newer
- pip and a virtual environment (recommended)
Installation Command
Open your terminal and run the following command:
pip install tessera-dashboard
This will install the library and all its necessary dependencies, including pandas.
How to Use Tessera
The workflow for creating a dashboard in Tessera is straightforward and can be summarized in a few steps:
- Import Components: Start by importing the `Dashboard` class and the layout and content components you need (e.g., `VStack`, `HStack`, `LineChart`, `Table`).
- Prepare Your Data: Load your data into pandas DataFrames. This is the format that Tessera’s components expect.
- Instantiate the Dashboard: Create an instance of the `Dashboard` class, providing your layout components as the argument. You can nest `HStack` and `VStack` components to create any grid-like structure.
- Add Content: Add your content components (charts, tables, text) to the layout containers. When creating a chart, you pass in your DataFrame and specify the columns to be used for the x and y axes.
- Export the Dashboard: Call the `export()` method on your dashboard object, providing a filename and a title. This will generate the final, self-contained HTML file.
Code Examples
The following examples, adapted from the official repository, demonstrate how easy it is to create a simple yet powerful dashboard.
Example 1: A Simple Dashboard with a Line Chart
This code creates a dashboard with a title and a single interactive line chart, using a pandas DataFrame as the source.
import pandas as pd
from tessera import Dashboard, LineChart, Text, VStack
# 1. Prepare your data
df = pd.DataFrame({"x": range(10),"y": [x**2 for x in range(10)]})
# 2. Define the dashboard layout and content
dashboard = Dashboard(
VStack(
Text("My First Tessera Dashboard"),
LineChart(df, x="x", y=["y"])
)
)
# 3. Export to a single HTML file
dashboard.export("my_dashboard.html", title="Analysis Results")
print("Dashboard exported to my_dashboard.html")
Example 2: A Two-Column Layout with Multiple Charts
This example demonstrates the use of `HStack` to create a side-by-side layout with a scatter plot and a table.
import pandas as pd
import numpy as np
from tessera import Dashboard, ScatterChart, Table, Text, HStack, VStack
# 1. Prepare data for scatter plot and table
df_scatter = pd.DataFrame({"x": np.random.rand(50),"y": np.random.rand(50),"category": np.random.choice(["A", "B"], 50)})
# 2. Define a more complex layout
dashboard = Dashboard(
VStack(
Text("Experiment Comparison"),
HStack(
ScatterChart(df_scatter, x="x", y="y", category="category"),
Table(df_scatter.head(10))
)
)
)
# 3. Export the file
dashboard.export("comparison_dashboard.html", title="Comparison")
print("Dashboard exported to comparison_dashboard.html")Real-World Use Cases
- ML Model Comparison: Create a dashboard showing training curves (loss, accuracy), confusion matrices, and key performance metrics for several different models side-by-side.
- Data Validation Reports: Generate an interactive report after a data processing pipeline runs, showing data distributions, null value counts, and outlier detection plots.
- A/B Test Analysis: Share the results of an A/B test with stakeholders, including conversion rate charts, statistical significance metrics, and tables with segmented user data.
- Exploratory Data Analysis (EDA) Summary: Condense the key findings from a lengthy Jupyter notebook into a clean, shareable dashboard for team members who need the insights without the code.
Contributing to Tessera
Tessera is an open-source project and community contributions are welcome. While there is no formal contributing guide, the standard GitHub workflow applies. You can report bugs or suggest new features by opening an Issue on the repository. To contribute code, it is best to fork the project, create a feature branch, and then submit a Pull Request for review by the maintainer.
Community and Support
The primary channel for support and community interaction is the GitHub Issues page. This is the best place to ask questions, report problems, and engage with the project’s developer. You can also explore the live demo to see the full capabilities of the library in action.
Conclusion
Tessera is a focused and elegantly designed tool that solves a common and frustrating problem for data scientists and ML engineers. It strikes a perfect balance, offering the interactivity of a web app without the overhead of deploying and maintaining one. Its unique ability to produce self-contained, shareable HTML files makes it an invaluable tool for effective communication and collaboration in any data-driven team.
If you’ve ever found yourself taking screenshots of your Jupyter plots or wishing you could send an interactive report without spinning up a server, Tessera is the library you’ve been waiting for. Its simple, declarative API means you can create a professional-looking dashboard in minutes, not hours. For your next analysis or experiment, give Tessera a try—it might just become an essential part of your data science toolkit.
We encourage you to check out the project, star the repository on GitHub to show your support, and see how it can streamline your data visualization workflow.
What is Tessera?
Tessera is a Python library used to create interactive, web-based dashboards for data analysis and machine learning experiments. Its key feature is the ability to export a complete, interactive dashboard into a single, self-contained HTML file that can be easily shared and viewed in any modern web browser without needing a live server.
How is Tessera different from Streamlit or Dash?
While Streamlit and Dash are powerful frameworks for building complex, stateful web applications that require a live Python server, Tessera is designed for creating interactive but self-contained ‘snapshot’ reports. Tessera’s output is a single HTML file that you can send via email or host on a static site, making it much simpler for sharing specific analyses without the overhead of server deployment.
Does Tessera require a server to run the dashboards?
No, it does not. This is Tessera’s main advantage. The `export()` function packages all the data, UI components, and interactive logic into one HTML file. Anyone can open this file locally in their browser and get the full interactive experience without needing Python, a server, or any other dependencies.
What kind of charts can I create with Tessera?
Tessera provides a core set of interactive components essential for data analysis. As of now, this includes Line Charts, Scatter Plots, Bar Charts, and Tables. You can combine these components in various layouts to build comprehensive dashboards.
Is Tessera free for commercial use?
Yes, Tessera is completely free for both personal and commercial use. It is released under the MIT License, which is a permissive open-source license that places very few restrictions on how you can use the software.
How do I install Tessera?
You can install Tessera easily using pip, the standard Python package installer. Simply run the command `pip install tessera-dashboard` in your terminal. This will download and install the library and its required dependencies.
Can I use pandas DataFrames with Tessera?
Yes, absolutely. Tessera is built to integrate seamlessly into the standard Python data science stack. All of its data components, such as `LineChart` and `Table`, are designed to accept pandas DataFrames as their primary data input.
Is Tessera a good replacement for TensorBoard?
Tessera serves a different purpose than TensorBoard. TensorBoard is a specialized tool for logging and visualizing metrics during deep learning model training. Tessera is a more general-purpose dashboarding tool, making it better suited for broader data analysis, comparing final model results, or creating reports with custom layouts and diverse data sources beyond just training logs.
