finterion-charts (Python)
Python binding for Finterion Charts.
This package does not render anything. It builds, validates, and encodes
ChartSpec JSON — the same JSON contract consumed by @finterion/charts-spec.
Rendering is done in the browser by @finterion/charts-core, so charts produced
from Python are pixel-identical to charts produced from TypeScript.
Interactive notebook charts support Shift + drag to box-zoom a time/price region with a dashed selection box (Escape cancels) and scrolling over a panel's Y-axis labels to zoom only that vertical scale. Normal dragging still pans; double-clicking the Y-axis resets its scale. These controls are included in the offline embed bundle and require no extra Python configuration.
Install
From PyPI (once published):
pip install finterion-charts # core: builder + cheap validator + codec
pip install "finterion-charts[schema]" # add jsonschema-based strict validation
pip install "finterion-charts[pandas]" # add pandas/numpy ergonomic builders
pip install "finterion-charts[jupyter]" # add IPython iframe display helper
pip install "finterion-charts[all]"
From this monorepo (editable):
cd bindings/python
pip install -e ".[all,dev]"
Quickstart
from finterion_charts import ChartSpec, Indicator, Price, Marker
spec = (
ChartSpec(theme="finterion-dark", background="#131722", grid="horizontal")
.with_bars(time=time, open=o, high=h, low=l, close=c, volume=v)
.with_column("rsi14", rsi)
.add_panel(Price(id="price", weight=3, title="AAPL", type="candles"))
.add_panel(Indicator.panel(
id="rsi", weight=1, title="RSI 14",
values="rsi14", color="#a3ff12",
ref_lines=[30, 70], y_range=(0, 100),
))
.add_marker(Marker(time=ts, side="buy", price=lo, label="B"))
.add_marker(Marker(time=ts, side="sell", price=hi, label="S"))
)
spec.validate() # raises ValueError on invalid spec
spec.to_json("chart.json")
url = spec.embed_url() # https://charts.finterion.com/embed/#spec=…
See examples/aapl_supertrend.py for an end-to-end
example with OHLC, RSI, SuperTrend overlay, and buy/sell markers.
Open or save a chart
spec.save("chart.html") # Write interactive HTML to this path.
spec.open() # Open a temporary HTML file in the default browser.
Both methods also work on ChartCanvas and return a pathlib.Path. The HTML is
self-contained: no internet connection, server, or Jupyter is needed. The
destination's parent directory must exist. open() leaves the temporary file
available for the browser to read. On WSL it uses the Windows default browser
through Windows interop. Use save() on a headless machine.
Donut and box-plot charts
Self-contained panels do not need OHLC bars:
from finterion_charts import Boxplot, ChartSpec, Donut
spec = (
ChartSpec(theme="finterion-light")
.add_panel(Donut(
id="assets", weight=1, title="Trades by asset",
categories=["BTC", "ETH"], values=[80, 30],
colors=["#f7931a", "#627eea"], center_label="TRADES",
))
.add_panel(Boxplot(
id="returns", weight=1, title="Window returns",
categories=["Vector", "Event"],
values=[[0.10, -0.04, 0.08], [0.09, -0.03, 0.07]],
show_points=True, format="pct1",
))
).validate()
Donut values must be finite and non-negative. The optional inner_radius
is strictly between 0 and 1 (default 0.55); show_total=False hides the total.
Box plots use min/max whiskers and observed-order quartiles, not interpolated
quartiles or outlier fences. show_points=True adds deterministic jittered
observations. Empty and singleton distributions are supported. Both panels
require one values entry and, when provided, one color per category.
Rebuild the offline embed bundle before distributing these new panel types.
Markers on indicator curves
Target a price or indicator panel with panel_id. For indicator panels,
price is the indicator's vertical value, not the instrument price:
spec.add_marker(Marker(
time=timestamp_ms, side="buy", price=30.0,
panel_id="rsi", shape="circle",
))
display(spec.display_in_jupyter())
Circles are centered on the supplied coordinate. side controls green/up
versus red/down styling; it need not represent an executed trade.
Without panel_id, existing markers still appear only on price panels.
Without shape, the existing arrow style is preserved. The offline bundle
must be rebuilt after renderer changes with
pnpm --filter @finterion/charts-embed-app... build at the repository root.
Decision cards
The main panel's right-hand legend lets you toggle long/short entries and exits
independently, plus undecided dots, using labeled eye icons alongside the series
controls. Filters also update hover targets and inspector choices.
Hover or focus a left-toolbar button for a description. X axis placement
opens a modal popover to choose a time-based panel or the bottom of the chart;
Apply confirms, while Cancel, Escape or an outside click leaves it unchanged.
Panel visibility opens a multi-select checkbox window: check panels to show
them, uncheck to collapse them, or use Show all / Hide all, then Apply.
It uses the same collapse behavior as panel eye buttons and respects
collapsible=False. Cancel, Escape and outside clicks discard pending changes.
Enter fullscreen expands the current chart, toolbar and inspectors; Escape
or Exit fullscreen restores the original size without resetting chart state.
Both offline and URL-mode iframes delegate fullscreen permission, but an outer
host such as VS Code or a browser policy can still deny it. In that case the
chart shows an explicit error. Rerun the chart display after rebuilding the
offline bundle; existing notebook outputs retain their old embedded JavaScript.
The decision inspector starts with card
selectors for the hovered/pinned UTC timestamp, the actual signal outcome and
blocking reason, and the large actual-score readout with group capacity bars.
Optional card.reason (nullable), strength, position, and qualification
carry recorded signal and pre-signal context.
card.reasonDescription provides a readable explanation above the raw reason
code, without replacing that code or calculating trade eligibility.
Signal strength is distinct from
score utilization (score / maximum); neither is a win probability.
Group minimumScore, minimumMatches, and aggregation, plus rule weight
and required, drive the condition/weight/earned tables. Supply
card.maximumScore and each scoring group's score/maximumScore; missing
maxima are explicitly shown as not recorded, not inferred from earned points.
It does not invent /100 normalization.
Multi-chart canvas
Use one canvas instead of displaying separate chart iframes:
from finterion_charts import ChartCanvas
canvas = ChartCanvas(
title="Strategy exploration",
charts={"BTC/EUR": btc_chart, "ETH/EUR": eth_chart},
layout="single",
columns=2,
chart_height=720,
selector={"type": "tabs", "label": "Symbol"},
)
display(canvas.display_in_jupyter(height=800))
charts maps stable, non-empty IDs (also used as labels) to ChartSpec objects
or chart-spec dictionaries. layout="single" shows one active chart; "grid"
shows selected charts with up to columns columns, stacking on narrow screens.
The Single/Grid buttons switch layouts interactively; set layout_toggle=False
to hide them. Each grid chart uses chart_height pixels; single mode fills the
available canvas height. selected=["BTC/EUR"] sets the initial selection;
by default all charts are selected for grid mode and the first is active in
single mode. An empty grid selection shows a prompt.
Selector types are "dropdown", "tabs", "multiselect" and "checkboxes".
Dropdowns become native multi-select lists in grid mode; tabs become independent
toggle buttons; checkboxes become radio buttons in single mode. Charts stay
mounted when hidden, preserving their independent zoom, collapsed panels,
line visibility and pinned decisions. The canvas uses one offline iframe;
URL display mode works with an updated hosted embed app as well.
Hold Ctrl (or Cmd) while scrolling over the chart, its legends, or axes to zoom the time scale at the pointer. Ordinary scrolling still scrolls tall charts. The Powered by Finterion badge stays at the bottom of the visible chart area while scrolling through panels.
Evidence below the score is split into numbered visual sections. Weighted rules
show status icons, references/timeframes, awarded points and optional
maximumPoints denominators; requirements and other evidence remain separate.
Group counters and thresholds are available in expandable recorded details.
Use ChartSpec.add_decision(dict) to append JSON-only evaluations (returns
self). These are independent of trade markers:
spec.add_decision({
"id": "entry-evaluation-42",
"time": timestamp_ms, # Unix seconds also accepted
"panelId": "rsi",
"value": 29.5, # panel Y coordinate, not instrument price
"action": "entry", # rejected entries are orange
"direction": "long", # optional
"card": {
"title": "Entry evaluation",
"status": "rejected", # extensible outcome string
"reasonDescription": "Entry blocked: the recorded minimum score was not met.",
"summary": "Below the minimum score.",
"score": 7, "minimumScore": 12, # optional, raw units
"groups": [{
"id": "signal", "title": "Signal evidence",
"rules": [{
"id": "rsi-low", "label": "RSI below 30",
"matched": True, "value": 29.5, "points": 7,
"timeframe": "1h", "description": "Raw RSI",
}],
}],
},
}).validate()
Nonempty decisions show a full-height, independently scrollable inspector
to the right of the chart and legend. Hover a bar to inspect its evaluations;
on narrow viewports it stacks below the chart.
Optional signalType values scale_in and scale_out render + and - symbols;
stop_loss and take_profit render SL/TP badges. Add eventType: "trigger"
for a hollow badge or "fill" for a solid badge. Triggers and fills have
separate legend filters, and simultaneous events remain individually selectable.
These events do not require confluence scores. Existing decision circles are
unchanged. Marker(..., shape="plus") and shape="minus" are also supported.
Drag its left edge to make it narrower or wider (220-800px, capped at 65% of the
chart width), or focus that divider and use Left/Right, Home or End.
Double-click the divider to reset its default 280-420px width. The header button
collapses and expands it, preserving its width and pinned card for that chart.
On narrow viewports, the collapsed inspector becomes a compact header.
coincident evaluations have a card count and compact selection buttons. Set
optional label on each annotation for a short card name such as Long entry.
Selecting a card type is preserved when resuming hover at later timestamps.
Neutral dots are smaller and faint; coincident neutral dots are drawn once
without discarding any cards. Timestamp-local card selectors are keyboard
accessible; timestamps are chosen by hovering the chart, not a dropdown.
Position-inapplicable exits use card.status="not_triggered" and grey dots,
selector accents and hover rings. The inspector shows "Not triggered" and,
when no score exists, "Not evaluated"; genuine pipeline rejections are unchanged.
Click a dot (not a drag) to pin its card and persistent highlight. Moving the
pointer away does not clear the selection; clicking another dot moves it.
Click empty plot space to clear the selection and follow hover again.
Clicking the selected dot again keeps it selected. Empty bars do not retain stale
cards. No decisions means no inspector. Hover within 12px of a decision dot to
snap the crosshair onto it and show a highlight ring and hand pointer. Click to
pin; click a different dot to switch the pinned timestamp. Chart panning starts
outside these magnetic targets.
For independently scrolling chart and decision columns, set
spec.display.chart_min_height = 1600 and render with
spec.display_in_jupyter(height=720). The chart stack retains its minimum height
inside the shorter viewport; the decision inspector has its own scrollbar.
Use the mouse wheel to scroll overflowing charts, or Ctrl/Command + wheel to zoom.
Without chart_min_height, the chart still fits its container as before.
matched may be true/false/null or absent: absent means neutral Recorded
evidence, while explicit null means Not evaluated. Values may be
string/number/boolean/null. Groups also accept optional boolean/null matched;
their result is never inferred from the rules (OR/threshold/veto logic may
differ). Statuses are not an enum. HTML is displayed as text. See the full
decision contract.
The bundled offline renderer must be rebuilt with
pnpm --filter @finterion/charts-embed-app... build before packaging the wheel.
Panels accept collapsible=True to enable their pane-collapse eye, including
the first panel, or False to keep a panel expanded. For example:
Indicator.panel(id="equity", weight=2, values="portfolio.equity", collapsible=True).
Omitting the option preserves the default: only panels after the first collapse.
Collapsed panels retain a compact header and an expand control.
Licence
Finterion Community Licence v1.0 (source-available, not OSI-approved).
Free to use — including commercially — as long as the default "Powered by
Finterion" badge stays visible on rendered charts. To remove the badge or to
build a competing hosted charting service, you need a commercial licence:
contact licensing@finterion.com. See the LICENSE file shipped with the
wheel, or the full text on GitHub.
Metadata
Release files for finterion-charts 1.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| finterion_charts-1.6.0.tar.gz | 1.0 MB | With provenance | Details for finterion_charts-1.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| finterion_charts-1.6.0-py3-none-any.whl | Python 3 | none | any | Details for finterion_charts-1.6.0-py3-none-any.whl |
Total release size: 1.2 MB
Release files / finterion_charts-1.6.0.tar.gz
| Download URL | finterion_charts-1.6.0.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6c71e8f4de8a1df24e5afa950239c1583947c15ee3394d8f51d7539f29c1ded
|
|
BLAKE2b-256 checksum How to use checksums |
57b61a8016e8eb4e7fbd6d9610fe1dd24354b7cbd4bb80d3c4a672c0982f3a3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logRelease files / finterion_charts-1.6.0-py3-none-any.whl
| Download URL | finterion_charts-1.6.0-py3-none-any.whl |
|---|---|
| Size | 179.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec74d5d83d82c840532a204bc203ef9f71c6c7d68bf9a03a016725e788aa8dc0
|
|
BLAKE2b-256 checksum How to use checksums |
54cbc0cb43e753bf524084e83c84cc6f663427520b4214d5863bbcc98f2bd1b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logSecurity for finterion-charts 1.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for finterion_charts-1.6.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.