Skip to main content

A lightweight static HTML dashboard generator with Plotly and pandas support.

Project description

staticdash

staticdash is a lightweight Python module for creating static, multi-page HTML dashboards. It supports Plotly plots, tables, and text content, with a fixed sidebar for navigation.

Installation

Clone the repository and install it in editable mode:

git clone https://github.com/briday1/staticdash.git 
cd staticdash
pip install .

Usage

Create a Python script like this:

from staticdash.dashboard import Dashboard, Page
import plotly.express as px
import pandas as pd
import numpy as np

# Create sample data
df = pd.DataFrame({
    "Category": ["A", "B", "C", "D"],
    "Value": [10, 20, 30, 40]
})

df2 = pd.DataFrame({
    "Time": pd.date_range("2024-01-01", periods=10, freq="D"),
    "Signal": np.random.randn(10).cumsum()
})

fig1 = px.bar(df, x="Category", y="Value", title="Bar Chart Example")
fig2 = px.line(df2, x="Time", y="Signal", title="Signal over Time")

# Build dashboard
dashboard = Dashboard(title="StaticDash Demo")

# Page 1: Overview
page1 = Page("overview", "Overview")
page1.add("Welcome to the StaticDash demo. Below is a bar chart and a table.")
page1.add(fig1)
page1.add(df)

# Page 2: Timeseries
page2 = Page("timeseries", "Timeseries")
page2.add("Here is a random time series with cumulative noise.")
page2.add(fig2)
page2.add(df2)

# Page 3: Summary
page3 = Page("summary", "Summary")
page3.add("Summary and notes can be added here.")
page3.add("StaticDash is a lightweight static dashboard generator.")

# Page 4: Download
page4 = Page("download", "Download")
page4.add("Here is a button to download a file.")
page4.add_download('./test_file.txt', "Download File")
page4.add_download('./test_file2.txt', "Download Another File")

# Register pages
dashboard.add_page(page1)
dashboard.add_page(page2)
dashboard.add_page(page3)
dashboard.add_page(page4)

# Export
dashboard.publish(output_dir="output")

After running the script, open output/index.html in your browser.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

staticdash-0.2.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

staticdash-0.2.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file staticdash-0.2.0.tar.gz.

File metadata

  • Download URL: staticdash-0.2.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for staticdash-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e0513d37e7d0d716f988d97e45d2086acf76ded9d87d355d5f80b44e6ecbdb1a
MD5 0f7a072e6d068c43d19f9a1bf9f6fe8c
BLAKE2b-256 e637e7200b2785702676c66a51eb1801e3b375aae89642beb073f4e8df74971b

See more details on using hashes here.

File details

Details for the file staticdash-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: staticdash-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for staticdash-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 508540c89c2e35824911579780ae3fa5117cf54d9042dc07edd7e2e2374fda2d
MD5 e865d5f87723799e4f4fd1db40a6cc64
BLAKE2b-256 ea6c3dee5d8e9965840ee998fe3e4c0adaf8f266e56b80c0922e31c9f13182b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page