stockstats
DataFrame with inline stock statistics support.
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 stockstatsuv
uv add stockstatspoetry
poetry add stockstatsInstalling 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
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
ft-pandas-taProvides 130+ technical analysis indicators and…
permissive · top 15,000 on PyPI
technicalTechnical provides a collection of technical…
copyleft · top 15,000 on PyPI
taComputes technical analysis indicators (volume,…
permissive · top 5,000 on PyPI
pandas-ta-classicPandas TA Classic provides 193 technical…
permissive · top 15,000 on PyPI
TA-LibPython wrapper for the TA-Lib C library…
unclear · top 5,000 on PyPI
hampelHampel detects and filters outliers in…
permissive · top 15,000 on PyPI
pandas-taProvides over 150 technical analysis indicators…
unclear · top 5,000 on PyPI
tushareFetches historical and real-time Chinese stock…
permissive · top 15,000 on PyPI
alpha-vantageFetches real-time and historical stock,…
permissive · top 15,000 on PyPI
finance-datareaderFetches historical and current financial…
permissive · top 15,000 on PyPI