Skip to content

Getting Started

Welcome to HolySheet! This guide will take you from zero to a fully interactive dashboard in under 5 minutes.


๐Ÿ“ฆ Installation

Basic Install

pip install holysheet

With DataFrame Support

pip install holysheet[pandas]
pip install holysheet[polars]
pip install holysheet[all]

Requirements

  • Python 3.11+
  • No Node.js required
  • No frontend build step
  • No running server

Core dependencies (installed automatically): pydantic v2 ยท jinja2 ยท orjson ยท loguru ยท click


๐Ÿ“ Your First Report

Step 1: Import

my_report.py
from holysheet import Report, KPI, LineChart, Markdown

Step 2: Create a Report

my_report.py
report = Report(
    title="My First Dashboard",
    subtitle="Built with HolySheet",
    theme="dark",
)

Step 3: Add Blocks

my_report.py
# Add a welcome message
report.add(Markdown(content="## Welcome\n\nThis is my first HolySheet dashboard!"))

# Add KPI cards
report.add(KPI(label="Total Users", value="2,890", delta="+13.8%", status="positive"))
report.add(KPI(label="Active Rate", value=78, unit="%", delta="+2.1%", status="positive"))
report.add(KPI(label="Revenue", value="$124K", delta="+18%", status="positive"))

# Add a chart
monthly_data = [
    {"month": "Jan", "users": 1_200},
    {"month": "Feb", "users": 1_450},
    {"month": "Mar", "users": 1_830},
    {"month": "Apr", "users": 2_100},
    {"month": "May", "users": 2_540},
    {"month": "Jun", "users": 2_890},
]

report.add(LineChart(
    title="User Growth",
    data=monthly_data,
    x="month",
    y="users",
    height=400,
))

Step 4: Export

my_report.py
report.export_html("my_report.html")
print("Done! Open my_report.html in your browser.")

Step 5: Open & Share

open my_report.html
xdg-open my_report.html
start my_report.html

Congratulations!

You just built an interactive dashboard with zero frontend knowledge. The HTML file is fully self-contained โ€” share it however you like.


๐Ÿ— Understanding the Architecture

HolySheet operates in two distinct phases:

Python API  โ†’  Pydantic v2 Schema  โ†’  JSON Spec  โ†’  React Renderer  โ†’  HTML Dashboard

๐Ÿ”ง Build Time (Python โ€” your machine)

  1. Define blocks using the Python API (KPI, LineChart, etc.)
  2. Validate everything with Pydantic v2 models โ€” catch errors early
  3. Generate a versioned JSON dashboard specification
  4. Inject the spec into a prebuilt React application
  5. Export a self-contained HTML file via Jinja2 templates

๐ŸŒ Runtime (Browser โ€” any machine)

  1. Browser opens the HTML file (no server needed)
  2. React reads the embedded dashboard spec from <script id="report-data">
  3. Renders each block through a component registry (type โ†’ React component)
  4. Charts become interactive via Apache ECharts
  5. Tables support real-time search and pagination

Key Insight

The React app is prebuilt and bundled inside the Python package. End users never need Node.js, npm, or any frontend tooling. The magic happens at pip install time.

How Blocks Work

Every block in HolySheet is a Pydantic v2 model with a type discriminator field:

from holysheet.blocks import KPI

kpi = KPI(label="Revenue", value="$1.2M", delta="+12%", status="positive")

# Each block serializes to a dict for the React renderer:
print(kpi.to_props())
# {'label': 'Revenue', 'value': '$1.2M', 'delta': '+12%', ...}

The Report class manages a list of blocks and assigns sequential IDs (block_001, block_002, โ€ฆ) for deterministic output.


๐Ÿ“ค Export Formats

HolySheet supports three export modes:

report.export_html("report.html")

Generates a single self-contained HTML file (~1.5 MB) with embedded React, CSS, and data. Zero external dependencies.

Best for

Email attachments, Slack sharing, embedding in Confluence or Notion, offline viewing.

Folder Export

report.export_folder("dist/")

Generates a deployable folder structure:

dist/
โ”œโ”€โ”€ index.html          โ† Entry point
โ”œโ”€โ”€ report.json         โ† Dashboard spec
โ”œโ”€โ”€ spec-loader.js      โ† Auto-generated loader
โ””โ”€โ”€ assets/
    โ”œโ”€โ”€ app.js          โ† React bundle
    โ””โ”€โ”€ app.css         โ† Styles

Best for

Hosting on a web server, S3, CDN, or GitHub Pages.

JSON Export

report.export_json("report.json")

Exports just the dashboard specification as JSON.

Best for

Debugging, version control, feeding into external rendering pipelines, programmatic manipulation.


โžก Next Steps

Now that you have the basics down, explore: