Skip to content

Quick start

Install

Use Python 3.11 or newer. Install into the environment where your code runs:

python -m pip install plotsrv
uv add plotsrv

No config file is needed.

Show an object

Start an interactive Python session (python, or uv run python in a uv project):

import plotsrv as ps

ps.publish_view(
    {"status": "ok", "rows": 123},
    label="status",
    launch_server=True,
)

Open http://127.0.0.1:8000. Expand the dictionary to inspect its values. The server runs in this Python process; leave the session open.

The quick-start dictionary in plotsrv, with status ok and 123 rows.

The quick-start dictionary in plotsrv, with status ok and 123 rows.

The result of the first example. Click to enlarge.

Publish again with the same label to replace that view:

ps.publish_view({"status": "done", "rows": 456}, label="status")

Try a table

In the same session:

import pandas as pd

orders = pd.DataFrame({
    "region": ["North", "South", "North"],
    "orders": [12, 18, 9],
    "revenue": [240, 540, 180],
})
ps.publish_view(orders, label="orders")

Choose orders in the view selector. Search the rows or click a column to sort them. pandas is installed with plotsrv’s table dependencies.

That’s enough to try it. When finished:

ps.stop_server(join=True)

Explore tables, plots, and saved views once you have some data.

Next

The ETL example shows a complete script. Unlike the interactive example above, it publishes to a separate server so the browser remains available after the script finishes.