Skip to content

Welcome to Datapane

Datapane is a Python library for building interactive reports for your end-users in seconds.

Get started

Get up and running in minutes with our Quickstart guide, or get started with our in-depth tutorials and guides below.

  • Tutorials


    Learn how to use Datapane through short exercises.

    Get started

  • Guides


    Follow how-to guides that solve real-world problems.

    Guides

  • Explanations


    Read explanations of Datapane-specific concepts.

    Explanations

  • Reference


    View the technical descriptions of the API and how to operate it.

    Reference

What is Datapane?

Import our library into your existing script/notebook and build reports programmatically by wrapping components such as:

Datapane reports are flexible and can also contain pages, tabs, drop downs, and more. Once created, reports can be uploaded to the web, dynamically generated in the cloud, or embedded into your own application, where your viewers can interact with your data and visualizations.

Here's an example of a basic Datapane report exported to a HTML document:

import pandas as pd
import altair as alt
import datapane as dp

df = pd.read_csv(
    "https://covid.ourworldindata.org/data/vaccinations/vaccinations-by-manufacturer.csv",
    parse_dates=["date"],
)
df = (
    df.groupby(["vaccine", "date"])["total_vaccinations"].sum().tail(1000).reset_index()
)

plot = (
    alt.Chart(df)
    .mark_area(opacity=0.4, stroke="black")
    .encode(
        x="date:T",
        y=alt.Y("total_vaccinations:Q"),
        color=alt.Color("vaccine:N", scale=alt.Scale(scheme="set1")),
        tooltip="vaccine:N",
    )
    .interactive()
    .properties(width="container")
)

total_df = (
    df[df["date"] == df["date"].max()]
    .sort_values("total_vaccinations", ascending=False)
    .reset_index(drop=True)
)
total_styled = total_df.style.bar(
    subset=["total_vaccinations"],
    color="#5fba7d",
    vmax=total_df["total_vaccinations"].sum(),
)

report = dp.Report(
    "## Vaccination Report",
    dp.Plot(plot, caption="Vaccinations by manufacturer over time"),
    dp.Table(total_styled, caption="Current vaccination totals by manufacturer"),
)

report.save(path="basic-report.html")