A Python library that provides a DataFrame subclass with inline stock statistics support, including common technical indicators (e.g., SMA, EMA, RSI, MACD, Bollinger Bands) and more advanced indicators like Supertrend, Ichimoku Cloud, KST, and PVO. The current version is 0.6.8, with active development on GitHub. Release cadence is irregular, roughly a few releases per year.
pip install stockstatsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Download stock data with yfinance, convert to StockDataFrame, and compute technical indicators.
Update column names to include the period (e.g., 'rsi_14', 'macd').
Ensure code handles Series output instead of scalar.
Use yfinance with keyword arguments for column mapping, or ensure column names match the expected format.
Upgrade to 0.6.6+ which fixes division-by-zero issues (PR #201).
Use: from stockstats import StockDataFrame
Access 'rsi_14' instead of 'rsi' (adjust period as needed).
Ensure index is unique: df = df[~df.index.duplicated(keep='first')]