Skip to main content

Minimal Technical Analysis Library for Python

This package offers a curated list of technical analysis indicators implemented in Cython for optimal performance. The library is built around numpy arrays and provides interfaces for numpy, pandas and polars.

[!NOTE] This project is experimental and the interface can change.

[!IMPORTANT] Function signatures have changed: multi-input functions no longer accept a prices DataFrame. Pass the required columns as separate arguments instead. For example, use atr(prices["high"], prices["low"], prices["close"]). See the indicator table below for the data inputs required by each function.

Interfaces

Mintalib offers three dedicated interfaces for different workflows:

  • Functions (mintalib.functions) — eager functions for NumPy arrays and pandas or polars series.
  • Indicators (mintalib.indicators) — composable indicators for pandas-based workflows.
  • Expressions (mintalib.expressions) — composable expression factories for polars-native workflows.

Conventions

Indicators and Expressions expect prices DataFrames to have lowercase column names such as open, high, low, close, and volume. If your data uses different capitalization, use the normalize_prices utility function to normalize its column names.

from mintalib.utils import normalize_prices

prices = normalize_prices(rawprices)

Functions

Concrete functions are available from the mintalib.functions module with names in lower case like sma, atr, macd, etc.

Functions accept NumPy arrays, pandas Series, or polars Series as inputs. Single-output functions preserve the input container type when possible; multi-output functions return an appropriate tabular or named result.

import mintalib.functions as ta

prices = ... # pandas or polars DataFrame

sma = ta.sma(prices['close'], period=50)
atr = ta.atr(prices['high'], prices['low'], prices['close'], 14)
macd = ta.macd(prices['close'])  # macd, macdsignal, macdhist result

Indicators (pandas only)

Indicators are available from mintalib.indicators with upper-case names such as SMA, EMA, ATR, and MACD.

Indicators bind calculation functions and their parameters together into callable objects. They are particularly useful with pandas DataFrame.assign.

from mintalib.indicators import SMA, EMA, ROC, RSI, MACD

prices = ... # pandas DataFrame

result = prices.assign(
    ema20 = EMA(20),
    rsi = RSI(14),
    trend = EMA(20) | ROC(1)
)

Expressions (polars only)

Polars expression factories are available from mintalib.expressions with upper-case names such as SMA, EMA, ATR, and MACD.

Their signature is parameters first like period followed by optional expression inputs like src for single series indicators, or open, high, low, close, volume for multi-input expressions.

Series expressions can be composed with the .pipe method, as in pl.col("close").pipe(EMA, 20). Multi-output calculations such as MACD return a polars struct expression that you can unpack with .struct.unnest().

from mintalib.expressions import EMA, ATR, ROC, MACD

prices = ... # polars DataFrame

result = prices.with_columns(
    EMA(20).alias("ema"),
    ATR(14).alias("atr"),
    EMA(20).pipe(ROC, 1).alias("trend"),
    MACD().struct.unnest()
)

List of Indicators

Name Data inputs Description
ABS series Absolute Value
ADX high, low, close Average Directional Index
ALMA series Arnaud Legoux Moving Average
ATR high, low, close Average True Range
AVGPRICE open, high, low, close Average Price
BBANDS series Bollinger Bands
BBP series Bollinger Bands Percent (%B)
BBW series Bollinger Bands Width
BOP open, high, low, close Balance of Power
CCI high, low, close Commodity Channel Index
CLAG series Confirmation Lag
CMF high, low, close, volume Chaikin Money Flow
CROSSOVER series Cross Over
CROSSUNDER series Cross Under
DEMA series Double Exponential Moving Average
DIFF series Difference
DMI high, low, close Directional Movement Indicator
DONCHIAN high, low Donchian Channel
EMA series Exponential Moving Average
EXP series Exponential
FLAG series Flag Value
HMA series Hull Moving Average
KAMA series Kaufman Adaptive Moving Average
KELTNER high, low, close Keltner Channel
KER series Kaufman Efficiency Ratio
LAG series Lag Function
LINREG series Linear Regression (least squares moving average)
LINREG_RMSE series Linear Regression Root Mean Square Error
LINREG_RVALUE series Linear Regression R-Value
LINREG_SLOPE series Linear Regression Slope
LOG series Logarithm
LROC series Logarithmic Rate of Change
MACD series Moving Average Convergence Divergence
MACDV high, low, close Moving Average Convergence Divergence - Volatility Normalized
MAD series Rolling Mean Absolute Deviation
MAV series Generic Moving Average
MAX series Rolling Maximum
MDI high, low, close Minus Directional Index
MEDPRICE high, low Median Price
MFI high, low, close, volume Money Flow Index
MIN series Rolling Minimum
NATR high, low, close Normalized Average True Range
OBV close, volume On-Balance Volume
PDI high, low, close Plus Directional Index
PPO series Price Percentage Oscillator
QUADREG series Quadratic Regression (parabolic moving average)
QUADREG_CURVE series Quadratic Regression Curve
QUADREG_RMSE series Quadratic Regression Root Mean Square Error
QUADREG_RVALUE series Quadratic Regression R-Value
QUADREG_SLOPE series Quadratic Regression Slope
RMA series Rolling Moving Average (RSI style)
ROC series Rate of Change
ROCP series Rate of Change Percentage
RSI series Relative Strength Index
SAR high, low Parabolic Stop and Reverse
SIGN series Sign
SMA series Simple Moving Average
STDEV series Standard Deviation
STEP series Step Function
STOCH high, low, close Stochastic Oscillator
STREAK series Consecutive streak of values above zero
SUM series Rolling sum
TEMA series Triple Exponential Moving Average
TRANGE high, low, close True Range
TYPPRICE high, low, close Typical Price
UPDOWN series Flag for value crossing up & down levels
WCLPRICE high, low, close Weighted Close Price
WMA series Weighted Moving Average
ZLEMA series Zero-Lag Exponential Moving Average

Example Notebooks

Example notebooks are available in the examples folder.

Installation

pip install mintalib

Mintalib requires Python 3.11 or newer. The base install includes only NumPy; add pandas and/or polars for their corresponding objects and interfaces.

Prebuilt cp311-abi3 wheels are available for regular CPython 3.11 and newer on Linux (x86_64 and ARM64), macOS (Intel and Apple silicon), and Windows (x64). Supported installations therefore do not need a local C compiler.

Dependencies

  • python >= 3.11
  • numpy
  • pandas [optional]
  • polars [optional]

Related Projects

  • ta-lib Python wrapper for TA-Lib
  • pandas-ta Technical Analysis Indicators for pandas
  • ta Technical Analysis Library for pandas
  • finta Financial Technical Analysis for pandas
  • qtalib Quantitative Technical Analysis Library
  • polars-ta Technical Analysis Indicators for polars
  • polars-talib Polars extension for TA-Lib

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mintalib-0.1.9.tar.gz (861.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mintalib-0.1.9-cp311-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11+Windows x86-64

mintalib-0.1.9-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

mintalib-0.1.9-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

mintalib-0.1.9-cp311-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

mintalib-0.1.9-cp311-abi3-macosx_10_9_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11+macOS 10.9+ x86-64

File details

Details for the file mintalib-0.1.9.tar.gz.

File metadata

  • Download URL: mintalib-0.1.9.tar.gz
  • Upload date:
  • Size: 861.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mintalib-0.1.9.tar.gz
Algorithm Hash digest
SHA256 aff18228c345d3ac5e27a1121e8c47dd6869d7983410126d3bbcbd462e3368ea
MD5 89688617eeda0341f36063a4138d55df
BLAKE2b-256 735794c4b3f99c81e610dd835e4965f5709634c56e5cb2571a03a7900dc81e6d

See more details on using hashes here.

File details

Details for the file mintalib-0.1.9-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: mintalib-0.1.9-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mintalib-0.1.9-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8d8ced8fc4f65029fae2e8c8c2fd662dccedb9057be62984f6586ef79efb6c3b
MD5 48b2238fa80d37c48ea2f200c54a8785
BLAKE2b-256 f09975a25b6d72404d6a3ee4e830a02fa487e3be2c57e6b786625c69880fe15e

See more details on using hashes here.

File details

Details for the file mintalib-0.1.9-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: mintalib-0.1.9-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.11+, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mintalib-0.1.9-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 524d5fe148fbe47bd0a187b385f89c236809b4347503181837c98fbf618ca025
MD5 a33fc6d1e7d7a9643c48387d46f4fb0f
BLAKE2b-256 4559fdded1859eafe141d5d70f2df2d326c4d90eb6e177676a192271178e39d2

See more details on using hashes here.

File details

Details for the file mintalib-0.1.9-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: mintalib-0.1.9-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.11+, manylinux: glibc 2.17+ ARM64, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mintalib-0.1.9-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 caa16020f2ba3088ee94db0cfdc8cf0167f76dd76a83dabebcdce63850075259
MD5 73e048ab045255e7d7eae568a7177069
BLAKE2b-256 62105bc6594b2c15763e9788f32bd25122edd0e863914fa2262708023a502989

See more details on using hashes here.

File details

Details for the file mintalib-0.1.9-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: mintalib-0.1.9-cp311-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.11+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mintalib-0.1.9-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 08ba3a1208bb9d66a096bf9630e177dc3049df4ac3b1e19e74e0f2a4376711f8
MD5 e1fde1701b79ca23f98aac7e3c04154b
BLAKE2b-256 1922878566c702e81d048f95292fa6fb2eea2de6eb2f88d14f9d9b6fb85fff42

See more details on using hashes here.

File details

Details for the file mintalib-0.1.9-cp311-abi3-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: mintalib-0.1.9-cp311-abi3-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.11+, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mintalib-0.1.9-cp311-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 759fb723cfa7e7f0fde13cc344b8ce4854c7fc91a9e982620aaed2c45930e62e
MD5 ed0f9750b8dbc5878d07f51290c4d111
BLAKE2b-256 cc841fef5424f614b92ca5275b9232d4d36114f28a815595585ad56c5897ca74

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.12

6 files

0.1.11

6 files

0.1.10

6 files

This release

0.1.9 This release

6 files

0.1.8

6 files

0.1.7

6 files

0.1.6

1 file

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

0.0.36

1 file

0.0.35

1 file

0.0.34

1 file

0.0.33

1 file

0.0.32

1 file

0.0.31

1 file

0.0.30

1 file

0.0.29

1 file

0.0.28

1 file

0.0.27

1 file

0.0.26

1 file

0.0.25

1 file

0.0.24

1 file

0.0.23

1 file

0.0.22

1 file

0.0.21

1 file

0.0.20

1 file

0.0.19

1 file

0.0.18

1 file

0.0.17

1 file

0.0.16

1 file

0.0.15

1 file

0.0.14

1 file

0.0.13

1 file

0.0.12

1 file

0.0.11

1 file

0.0.10

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page