skillfed

stockstats

DataFrame with inline stock statistics support.

stockstats v0.6.8 219.7K downloads/30d#9,322 on PyPI1,486
Permissive license BSD-3-Clause Active released

What it is and what it does

stockstats wraps pandas DataFrames to add inline technical analysis indicators commonly used in stock trading and financial analysis. It provides a large library of pre-built indicators—moving averages (SMA, EMA, SMMA, TEMA, LRMA, KAMA, VWMA, DMA), momentum oscillators (RSI, MACD, Stochastic, KDJ, ROC, CMO, KST, Coppock, AO, BOP, CTI, Inertia, PSL), trend indicators (Supertrend, Aroon, Ichimoku, DMI, TRIX, Wave Trend), volatility measures (Bollinger Bands, ATR, CCI, Williams %R, CHOP, KER, Z-Score, MAD, PGO), volume analysis (VR, MFI, PVO, VWMA), and oscillators (QQE, RVGI, ERI, FTR)—plus utility functions for delta, shifts, log returns, and cross-over detection.

You initialize it by wrapping a pandas DataFrame containing standard OHLCV columns (close, high, low, volume, optionally date), then access indicators by column name patterns like `df['rsi']` or `df['close_20_sma']`. Indicators are calculated on first access and cached; you can delete a column to force re-evaluation. Multi-line indicators like MACD and Bollinger Bands generate multiple columns at once. The library supports Python 3.9+ and has no compiled dependencies.

Use it for:

  • Build trading signal detection systems by accessing RSI, MACD, or Bollinger Bands to identify overbought/oversold conditions and trend reversals.
  • Analyze historical stock data with cross-over detection (e.g., golden cross of 10-period and 50-period SMAs) to backtest trading strategies.
  • Generate multi-indicator dashboards by wrapping pandas data and accessing dozens of indicators with simple column access patterns.
  • Calculate momentum and volatility metrics (Stochastic RSI, ATR, CCI) for risk assessment and position sizing in algorithmic trading.
  • Detect trend changes using Supertrend, Aroon, Ichimoku, or DMI indicators to automate entry and exit signals.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Adds technical analysis indicators and statistics to pandas DataFrames for stock market data, including moving averages, momentum, trend, volatility, and volume calculations.

Yes. stockstats is actively maintained, has no security vulnerabilities, low install friction, and a permissive license. It provides a comprehensive, well-documented library of technical indicators for stock analysis. Install it if you need to add technical analysis to pandas-based financial workflows; skip it only if you require indicators not in its supported list or need real-time streaming optimizations.

Install

stockstats on PyPI

pip

pip install stockstats

uv

uv add stockstats

poetry

poetry add stockstats

Installing stockstats

Before you install

Low install friction with only numpy and pandas as dependencies. Active maintenance with a recent release on 2026-02-16 and last commit on 2026-06-19; the repository has 1486 stars.

License in practice

BSD-3-Clause is permissive and poses no restriction on commercial or private use.

Quickstart

pip install stockstats

import pandas as pd
from stockstats import wrap

df = wrap(pd.read_csv('stock.csv'))
rsi = df['rsi']
sma_20 = df['close_20_sma']

Requires Python 3.9+. Input DataFrame must contain OHLCV columns: close, high, low, volume (case-insensitive).

Verify before relying

  • Whether indicator calculations match industry-standard implementations or have known deviations from common trading platforms
  • Performance characteristics when working with large datasets or real-time streaming data
  • Accuracy of less common indicators like Ichimoku, Wave Trend, or Quantitative Qualitative Estimation relative to reference implementations

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 2 — numpy, pandas
Maintenance actively maintained — 179 days since the last release
Last repo commit
First released
Downloads 219,665/month — #9,322 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: stockstats-0.6.8-py3-none-any.whl

Keywords: stock, statistics, indicator

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Financial and Insurance IndustryNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Utilities

Tags

stock technical indicatorspandas stock analysisRSI MACD Bollinger Bandstrading indicators calculationstock statistics wrapperfinancial data analysismoving average indicators
technical-analysisfinancial-datatrading-indicators

More Utilities packages