klinepy
Python wrapper for KLineCharts (klinecharts@10) — one chart spec, three outputs: standalone HTML, embeddable fragment, marimo/anywidget widget.
Grayscale theme with a single amber accent (#d97706). The JS side loads the
klinecharts ESM build from jsDelivr (needs internet in the browser); the
Python side is pure data (polars/pandas frames or dicts — no data deps).
Usage
from klinepy import KLineChart, html, fragment
chart = KLineChart(
bars, # polars/pandas DataFrame or list of dicts
lines={"SMA 20": sma}, # optional overlay values, aligned/padded to bar count
title="AAPL",
indicators=[{"name": "MACD"}], # optional built-in klinecharts indicators
height=460,
)
# 1. marimo / Jupyter widget
mo.ui.anywidget(chart)
# 2. standalone HTML document (CDN ESM, no build step)
open("aapl.html", "w").write(chart.to_html()) # or: html(chart)
# 3. embeddable fragment for web apps (no <html> wrapper)
page += chart.fragment() # or: fragment(chart)
Development
uv sync
uv run pytest
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file klinepy-0.1.0.tar.gz.
File metadata
- Download URL: klinepy-0.1.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53931d805fa217a032d8cc236eac29d4c4f15faef4ae1029448462722df186b1
|
|
| MD5 |
238c15f0aefd275396b4058ebaf0cddf
|
|
| BLAKE2b-256 |
3f5a44e9c6c5330876f2132a9be03aac0a3fe8ee4410ad7105196510a6aaf593
|
File details
Details for the file klinepy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: klinepy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6a9509073005dd7bf1f04aa77ef85e6523df3f341830aed47e38a3afe736ace
|
|
| MD5 |
a91c0ed8a6a0ce1949f7217b77c51a74
|
|
| BLAKE2b-256 |
e8f068a1a7eaa9732f9e4229d04bc1fd11e94af4f58a8affb966d534380190cd
|