Skip to content

jointview

Compare two price or NAV series of a Polars DataFrame, side by side.

PyPI version

License: Apache-2.0 Python versions CI Coverage Code style: ruff uv marimo CodeFactor Rhiza Downloads

Run it

uvx jointview

That is the whole installation. uvx fetches the package and its dependencies for the length of the run and leaves nothing behind.

uvx jointview navs.parquet               # your own data
uvx jointview navs.parquet --height 900  # taller plot for a taller screen

jointview comparing two funds of the demo frame

Pick a series on each side. Both are drawn on one pair of axes, and each summary table describes exactly the rows in the plot — the common sample, where both series are present.

Why both lines share an axis

A second scale would invent a relationship that is not in the data. So both series are indexed to 100 at their first shared date, which is how a fund priced at 49 and one priced at 1,450 become comparable. The switch above the plot turns that off when the levels already share a scale.

Options

jointview the generated demo frame
jointview <file> .parquet, .csv, .tsv, .json, .ndjson, .arrow, .ipc, .feather
--height plot height in pixels (default 700)
--edit open the notebook itself, from a clone
-- … everything after a bare -- goes to marimo: -- --port 8080 --headless

The first temporal column becomes the x-axis; without one the rows are numbered. Every numeric column is offered as a series.

The pieces on their own

Neither the chart nor the statistics need marimo. uvx runs the app; to import the pieces, install the package from PyPI:

uv add jointview      # or: pip install jointview

Statistics come from jQuantStats, so the frame carries its period column into summary — the annualisation factor is read from the spacing of the observations rather than assumed.

from jointview import demo_frame, line_chart, metrics, summary

frame = demo_frame()

table = summary(frame, "balanced", date_col="date")                    # a formatted two-column frame
sharpe = metrics(frame, "tech_fund", date_col="date")["Sharpe ratio"]  # the raw number
chart = line_chart(frame, "balanced", "tech_fund")                     # a plain Altair chart

print(table.columns, table.height, dict(table.iter_rows())["Max drawdown"])
print(f"{sharpe:.2f}")
print(type(chart).__name__)
['metric', 'value'] 17 -15.90%
0.52
LayerChart

One line per claim above, in the same order — the table is two columns of formatted strings, the metric is a bare float, and the chart is Altair's own type rather than a marimo widget. The block is executed on every commit and its output compared against the result printed here, so a figure that drifts is a failing test rather than a stale README.

Seventeen figures per series — returns, volatility, Sharpe, Sortino, Calmar, drawdown, Ulcer index, value at risk, and the shape of the period returns. A figure that cannot be formed shows as rather than blanking the table.