Xpectral Chart
Fluent Bokeh charting that extends Polars and Pandas DataFrames via the
accessor pattern: df.bokeh.line(...), df.bokeh.scatter(...), and more.
Part of the Xpectral project, alongside xpectral-quant
(financial metrics and market data). Each installs its own top-level package
(xpectral_chart and xpectral_quant) and they can be used together.
Usage
import xpectral_chart # registers the df.bokeh accessor
from xpectral_chart import PandasDataFrame
from xpectral_chart import PolarsDataFrame
df: PolarsDataFrame = pl.DataFrame({"x": [1, 2, 3], "y": [4, 5, 6]})
fig = df.bokeh(title="Example", width=600, height=400)
fig.line(x="x", y="y")
pd_df: PandasDataFrame = pd.DataFrame({"x": [1, 2, 3], "y": [4, 5, 6]})
pd_fig = pd_df.bokeh(title="Example", width=600, height=400)
pd_fig.line(x="x", y="y")
Importing xpectral_chart is what registers the accessor on Polars and Pandas
DataFrames. Annotate sample DataFrames with PolarsDataFrame or
PandasDataFrame when you want the editor (pyright) to resolve the
df.bokeh(...) parameters and chained accessor methods: annotation is
necessary for type hinting, as accessors are not discovered dynamically.
Custom chart methods
Use BokehAccessor.register to add your own methods to the accessor. The
decorated function receives self (the accessor instance), giving access to
self._df, self.source, self.plot, and all built-in glyph methods.
from xpectral_chart import BokehAccessor
@BokehAccessor.register
def price_band(self, mid, upper, lower, **kwargs):
self.line(y=mid, **kwargs)
self.varea(y1=lower, y2=upper, fill_alpha=0.2, **kwargs)
fig = df.bokeh(title="Bands", width=800, height=400)
fig.price_band(mid="close", upper="upper", lower="lower")
The method is available on both Polars and Pandas accessors immediately after registration.
Install
pip install xpectral-chart
uv add xpectral-chart
For development:
uv sync
Metadata
Release files for xpectral-chart 2.0.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 |
|---|---|---|---|---|
| xpectral_chart-2.0.0.tar.gz | 1.7 MB | With provenance | Details for xpectral_chart-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xpectral_chart-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for xpectral_chart-2.0.0-py3-none-any.whl |
Total release size: 1.7 MB
Release files / xpectral_chart-2.0.0.tar.gz
| Download URL | xpectral_chart-2.0.0.tar.gz |
|---|---|
| Size | 1.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
26df9096216e08e37794159100a690a8204edf85f01640e10f76d138140cb57a
|
|
BLAKE2b-256 checksum How to use checksums |
c536a7462844fa1b8d5ce517b8235175522f29044e81c0797c2700fa0153871b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logRelease files / xpectral_chart-2.0.0-py3-none-any.whl
| Download URL | xpectral_chart-2.0.0-py3-none-any.whl |
|---|---|
| Size | 19.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc999e439d44d648175e4ab206fca7a6eacf82831ac4283e76fd1c9518905a9a
|
|
BLAKE2b-256 checksum How to use checksums |
010ef40f4712c9aaa3102085cd62e13a3e6185b2dc821ff20e5890269b89bd89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 14, 2026.
Transparency logSecurity for xpectral-chart 2.0.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 xpectral_chart-2.0.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 Oct 14, 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.