/polars-talib:polars-talibfrom polars-talib
Build and debug technical indicators in Polars using polars-talib expressions, including grouped time series, lazy queries, multi-output indicators, null handling, and migration to polars-talib 0.2.0.
Ships in polars-talib. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use polars-talib when the user wants TA-Lib indicators in a Polars pipeline. Import polars_talib to register .ta. The distribution name contains a hyphen; the import contains an underscore. Version 0.2.0 bundles TA-Lib 0.8.1 and exposes all 201 batch indicators. Its wheels do not need a system TA-Lib installation or the separate Python TA-Lib package.
Check the active interpreter and installed versions before changing dependencies. Install with that interpreter's package manager, for example python -m pip install 'polars-talib==0.2.0'. If 0.2.0 is not published yet, use the user's reviewed wheel or checkout; do not silently fall back to an older release. Python 3.10+ and Polars 1.20+ are required. Prefer a wheel for the user's platform; read the repository build documentation if no compatible wheel exists.
import polars as pl
import polars_talib as ta
result = (
bars.sort(["symbol", "timestamp"])
.with_columns(
ta.rsi(pl.col("close"), timeperiod=14).over("symbol").alias("rsi"),
ta.macd(pl.col("close")).over("symbol").alias("macd"),
ta.atr(pl.col("high"), pl.col("low"), pl.col("close"))
.over("symbol").alias("atr"),
)
.unnest("macd")
)
.over("symbol") to prevent history from one instrument leaking into another. Decide session boundaries explicitly for cumulative indicators such as VWAP; it does not reset at midnight automatically.select/with_columns, including lazy pipelines. Avoid Python map_elements or per-row loops. History-dependent indicators must see a complete ordered group; a streaming query is not the TA-Lib incremental streaming API.pl.col(...) for column arguments, especially legacy top-level functions. Namespace receiver conventions vary: RSI takes close, ATR's receiver is close with high/low arguments, and candlestick patterns use open. Inspect inspect.signature(ta.<function>) or the namespace method rather than guessing argument order..struct.field("macdhist"), or alias then unnest. Discover names through ta.get_functions_output_struct(); SuperTrend's trend and Fractal outputs are integers, while price outputs are Float64.ta.col("close").rsi(14) is pl.col("close").ta.rsi(14) with a static TAExpr return type; prefer it in type-checked code. Integer parameters accept whole-number floats such as 14.0 but reject 14.5.ta.get_functions() and ta.get_function_groups(). All 14 moving-average types are in ta.MA_Type, including HMA, RMA, ZLEMA, DISABLED and DEFAULT.Inputs cast to Float64. Leading missing rows and warm-up rows produce NaN for floating outputs, zero for integer outputs; they are not Polars nulls. Short groups retain their input length. Since 0.2.1, a null input (a missing observation) after the first usable row makes every output row that can depend on it null: to the end of the partition for recursive indicators (RSI, EMA, MACD, ATR, OBV, SMA, most candlestick patterns), for the lookback window for window-bounded ones (MAX/MIN, WILLR, AROON, ROC, math operators). It never becomes a plausible value, and under .over("symbol") it stays within that symbol. NaN and infinity are ordinary float values and reach TA-Lib unchanged with undefined results; convert them with .fill_nan(None) when they mean missing. To restart after gaps use .over("symbol", pl.col("close").is_null().cum_sum()); to skip market-closed rows, drop them per symbol before computing and join back. Filling prices changes the indicator, so choose a fill policy explicitly. Do not convert warm-up NaNs or nulls to zero without the user's intended semantics.
In 0.2.0, BBANDS defaults to period 20, and APO/PPO use EMA (matype=1). To reproduce older defaults, pass timeperiod=5 for BBANDS and matype=0 for APO/PPO. DARKCLOUDCOVER and MATHOLD use upstream penetration=0.5; older wrappers incorrectly defaulted to 0.3. Floating results can differ slightly because the newer core changes rounding and fixes algorithms. Use explicit parameters and tolerant numeric comparisons when migrating.
For a correctness check, compare the same Float64 input and explicit parameters with Python TA-Lib==0.8.1. Check output length, warm-up alignment, groups, and NaNs as well as numeric values. For performance work, benchmark release wheels on the same machine, data, Polars version and thread count. Measure the complete query and record medians; do not promise universal speedups or financial returns.
reference/functions.md: every function with its namespace receiver, other inputs,
parameters with defaults and output names (generated from the pinned upstream API).reference/patterns.md: worked examples for multi-symbol pipelines, struct outputs,
custom input columns, candlestick patterns and verification against Python talib.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub yvictor/polars_ta_extension --plugin polars-talibOther plugins' skills for the same job