Repolode
TA-Lib

TA-Lib/ta-lib-python

Python wrapper for the TA-Lib C library, providing 200+ technical analysis indicators and candlestick pattern recognition on NumPy, Pandas, and Polars data.

Stars
12,373
Forks
2,005
Open issues
87
Last commit
2 days ago

Repolode describes open-source projects and does not give investment advice. Trading and investing can lose money: assess the risk yourself and follow the laws where you live before using this project.

What is it?

TA-Lib is a widely used technical analysis library implemented in C, and ta-lib-python exposes it to Python through a Cython binding. It covers indicators such as moving averages, MACD, RSI, Stochastic and Bollinger Bands, along with candlestick pattern recognition and statistical functions. Inputs can be NumPy arrays, Pandas Series or DataFrames, and Polars Series or DataFrames.

The package offers three interfaces: a Function API that mirrors the C library, an Abstract API that takes a dict or DataFrame of named OHLCV columns, and a Streaming API that keeps a per-indicator handle so each new bar updates the value in constant time without recomputing the history. Binary wheels bundle the C library for Linux, macOS and Windows, so most users do not need a compiler; source builds can either download a pinned TA-Lib release or link an existing installation.

The project documents NaN handling and lookback periods, which differ from Pandas rolling functions, and provides controls for unstable-period settings. Streaming and calculations can run across threads, including on free-threaded CPython builds.

Key features

  • 01Provides 200+ indicators across overlap, momentum, volume, volatility, cycle and statistic groups.
  • 02Includes candlestick pattern recognition functions.
  • 03Accepts NumPy, Pandas and Polars inputs.
  • 04Offers Function, Abstract and Streaming APIs.
  • 05Ships binary wheels with the C library bundled for major platforms and Python 3.9 to 3.14.

Use cases

  • Computing technical indicators on historical OHLCV data for backtesting trading strategies.
  • Adding indicator columns to a Pandas or Polars DataFrame during quantitative research.
  • Updating indicators bar by bar in a live market data feed using the Streaming API.
  • Detecting candlestick patterns in price series.

Quick start

  1. 1

    Install the package from PyPI

    python -m pip install TA-Lib
  2. 2

    Import the Function API and compute a simple moving average

    python -c "import numpy as np, talib; print(talib.SMA(np.random.random(100)))"

Things to know

  • Source builds need network access, a C compiler and CMake, and Windows source builds need Microsoft C++ Build Tools.

Topics

FAQ

What is ta-lib-python?
Python wrapper for the TA-Lib C library, providing 200+ technical analysis indicators and candlestick pattern recognition on NumPy, Pandas, and Polars data. TA-Lib is a widely used technical analysis library implemented in C, and ta-lib-python exposes it to Python through a Cython binding. It covers indicators such as moving averages, MACD, RSI, Stochastic and Bollinger Bands, along with candlestick pattern recognition and statistical functions. Inputs can be NumPy arrays, Pandas Series or DataFrames, and Polars Series or DataFrames.
Is ta-lib-python free to use? What license does it have?
ta-lib-python is open source under the BSD-2-Clause license. Check the license terms before using it in commercial products.
Is ta-lib-python still maintained?
Actively maintained. The last commit to ta-lib-python was on Nov 5, 2026.
What can I use ta-lib-python for?
Computing technical indicators on historical OHLCV data for backtesting trading strategies. Adding indicator columns to a Pandas or Polars DataFrame during quantitative research. Updating indicators bar by bar in a live market data feed using the Streaming API. Detecting candlestick patterns in price series.
How do I install ta-lib-python?
Install the package from PyPI: python -m pip install TA-Lib Import the Function API and compute a simple moving average: python -c "import numpy as np, talib; print(talib.SMA(np.random.random(100)))"
Where can I get ta-lib-python?
The source code and installation instructions are on GitHub: https://github.com/TA-Lib/ta-lib-python

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects