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.

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]
  • 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

Metadata

Release files for mintalib 0.1.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mintalib 0.1.13
File Size Uploaded
mintalib-0.1.13.tar.gz 862.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for mintalib 0.1.13
File
mintalib-0.1.13-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
mintalib-0.1.13-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
mintalib-0.1.13-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64, Linux glibc 2.28+ ARM64 Details
mintalib-0.1.13-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
mintalib-0.1.13-cp311-abi3-macosx_10_9_x86_64.whl CPython 3.11 abi3 macOS 10.9+ x86-64 Details

Total release size: 8.8 MB

Release files / mintalib-0.1.13.tar.gz

Download URL mintalib-0.1.13.tar.gz
Size 862.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b7aa0ef195ba8883dc6b231b5a70206c01ba56c3c5bf46a84c403491fb7b4265
BLAKE2b-256 checksum
How to use checksums
fcae4ae2da35cb4653ffe01ee1af68f6bbab9f8b6522efce7b576b1100f639af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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}

Release files / mintalib-0.1.13-cp311-abi3-win_amd64.whl

Download URL mintalib-0.1.13-cp311-abi3-win_amd64.whl
Size 1.1 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
01c79da04b39f6130ef4bf9bd2cf50cb6b45ec2f35696a2cde14bc9a34eb4f01
BLAKE2b-256 checksum
How to use checksums
35b6d418a57e1b8e928a946e0951c6dcd945281f3230d335a64f2915e39ee27c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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}

Release files / mintalib-0.1.13-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL mintalib-0.1.13-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 2.4 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
426e38924b08bd21be95206087fc1fd5751c4ab5d265143ce683cb8759e2b719
BLAKE2b-256 checksum
How to use checksums
4a07eec03413bf42f8af20360815b612cc0f783bd1270c224fc15c2dd2b0d912
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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}

Release files / mintalib-0.1.13-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL mintalib-0.1.13-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 2.4 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
e2f38d5c6fc0d4df8e0a8fc7dd75f7c4ed95bb588d27c6b187380ea8741e6e5c
BLAKE2b-256 checksum
How to use checksums
45713e27268b11e3a6ae76640099de6ad739adcf71852f5e8451fb2fa29b2704
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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}

Release files / mintalib-0.1.13-cp311-abi3-macosx_11_0_arm64.whl

Download URL mintalib-0.1.13-cp311-abi3-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
13ab79abc652e8523f1e1b3d656a941814c2198b1940a4aa74863cb80d08a26a
BLAKE2b-256 checksum
How to use checksums
6e206a8416072d55fe3307bf0460ed69a26539c1b7190873192cac0bbd327e9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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}

Release files / mintalib-0.1.13-cp311-abi3-macosx_10_9_x86_64.whl

Download URL mintalib-0.1.13-cp311-abi3-macosx_10_9_x86_64.whl
Size 1.1 MB
Tags CPython 3.11 abi3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
c389ed5ba2c035620b9c304717291eca4844c517a963c1c90d9e40c775ffc98c
BLAKE2b-256 checksum
How to use checksums
13465b97c40ccec068e69e1fd3d5c4f6e0438bc2ca4418b27d3db939bf132939
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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}

Release history Release notifications | RSS feed

This release

0.1.13 This release

6 release files

0.1.10

6 release files

0.1.9

6 release files

0.1.8

6 release files

0.1.7

6 release files

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.36

1 release file

0.0.35

1 release file

0.0.34

1 release file

0.0.33

1 release file

0.0.32

1 release file

0.0.31

1 release file

0.0.30

1 release file

0.0.29

1 release file

0.0.28

1 release file

0.0.27

1 release file

0.0.26

1 release file

0.0.25

1 release file

0.0.24

1 release file

0.0.23

1 release file

0.0.22

1 release file

0.0.21

1 release file

0.0.20

1 release file

0.0.19

1 release file

0.0.18

1 release file

0.0.17

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release 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