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 eager NumPy/pandas/polars calculations, composable pandas indicators, and native polars expressions.

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

Interfaces

Mintalib offers three equivalent calculation interfaces for different workflows:

  • Functions (mintalib.functions) — eager functions for NumPy arrays and pandas or polars objects.
  • Indicators (mintalib.indicators) — composable pandas indicators that bind a calculation with its parameters.
  • Expressions (mintalib.expressions) — composable expression factories for polars-native workflows.

Conventions

Prices DataFrames are expected to have lower case column names open, high, low, close, volume. If your DataFrame has different column name capitalization you can use the normalize_prices utility function to normalize the 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 objects, or polars objects as appropriate and return the same eager container type when possible.

The first parameter of a function is either prices or series depending on whether the function expects a dataframe of prices or a single series.

import mintalib.functions as ta

prices = ... # pandas or polars DataFrame

sma = ta.sma(prices['close'], 50)
atr = ta.atr(prices, 14)

Composable Indicators

For workflows that benefit from reusable or chained calculations, mintalib.indicators binds a function and its parameters into a callable object.

Indicators work with pandas DataFrames and Series. They are callable, and chain with | or the equivalent .then() method.

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 expression factories are available from mintalib.expressions with upper-case names such as SMA, EMA, ATR, and MACD.

Series calculations default to the close column and prices calculations read the full DataFrame when src is omitted. A column name or polars expression can be supplied through src, and a leading expression is accepted for composition with Expr.pipe. Multi-output calculations such as MACD return a polars struct expression.

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

prices = ... # polars DataFrame

result = prices.with_columns(
    ema20 = EMA(20),
    atr = ATR(14),
    trend = EMA(20).pipe(ROC, 1),
    macd = MACD()
)

List of Indicators

Name Input Description
ABS Series Absolute Value
ADX Prices Average Directional Index
ALMA Series Arnaud Legoux Moving Average
ATR Prices Average True Range
AVGPRICE Prices Average Price
BBANDS Series Bollinger Bands
BBP Series Bollinger Bands Percent (%B)
BBW Series Bollinger Bands Width
BOP Prices Balance of Power
CCI Prices Commodity Channel Index
CLAG Series Confirmation Lag
CMF Prices Chaikin Money Flow
CROSSOVER Series Cross Over
CROSSUNDER Series Cross Under
DEMA Series Double Exponential Moving Average
DIFF Series Difference
DMI Prices Directional Movement Indicator
DONCHIAN Prices Donchian Channel
EMA Series Exponential Moving Average
EVAL Prices Evaluate a pandas expression against a DataFrame's columns.
EXP Series Exponential
FLAG Series Flag Value
HMA Series Hull Moving Average
KAMA Series Kaufman Adaptive Moving Average
KELTNER Prices 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 Prices Moving Average Convergence Divergence - Volatility Normalized
MAD Series Rolling Mean Absolute Deviation
MAV Series Generic Moving Average
MAX Series Rolling Maximum
MDI Prices Minus Directional Index
MEDPRICE Prices Median Price
MFI Prices Money Flow Index
MIN Series Rolling Minimum
NATR Prices Normalized Average True Range
PDI Prices Plus Directional Index
PPO Series Price Percentage Oscillator
PRICE Prices Generic Price
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 Prices Parabolic Stop and Reverse
SIGN Series Sign
SMA Series Simple Moving Average
STDEV Series Standard Deviation
STEP Series Step Function
STOCH Prices Stochastic Oscillator
STREAK Series Consecutive streak of values above zero
SUM Series Rolling sum
TEMA Series Triple Exponential Moving Average
TRANGE Prices True Range
TYPPRICE Prices Typical Price
UPDOWN Series Flag for value crossing up & down levels
WCLPRICE Prices 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.8.tar.gz (851.0 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.8-cp311-abi3-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.11+Windows x86-64

mintalib-0.1.8-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.8-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.8-cp311-abi3-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

mintalib-0.1.8-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.8.tar.gz.

File metadata

  • Download URL: mintalib-0.1.8.tar.gz
  • Upload date:
  • Size: 851.0 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.8.tar.gz
Algorithm Hash digest
SHA256 e10cfd27766f00b028e819006c21c1d65d7d57012c4ab32f38d7dcd3e3957ebc
MD5 ac66e792211bfd640256650d5b8d2df4
BLAKE2b-256 c1c1ecf0dbed1ada1f870b90ab09c2326cc37a6dca90e0be3b0821c00389feef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mintalib-0.1.8-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.0 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.8-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 01938ff683b9d1b9d18e0ae9ba42454cf9d7821d7bb0d4e7f772ae69b408fb85
MD5 ec257aea60110d798d2e326d455b8439
BLAKE2b-256 75ec013ff58f2c2629d1a67bebef695802328458098f537f970e5e21f87f99d0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mintalib-0.1.8-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.8-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d2519fa9224b9db8d8dcb66c82331a0fc98897ea69d0111653f8809c439da3e5
MD5 f2ef0c556f542978d08698e9d54b28f8
BLAKE2b-256 5881e53812cd63ee726f91eb7e6d14983ac5a22807df508a3b0458b1b200f806

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mintalib-0.1.8-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.8-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8ee72fd6022394fad7989c8dcfba5b3b6a606ea0ee748f706a65ddfe934b2163
MD5 09e371f135a665a597f3bde44df8c0ee
BLAKE2b-256 e9a806607dcd6f23236f7c617842d19c59a60288cc20505fc158bdb3f6c78d37

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mintalib-0.1.8-cp311-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.0 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.8-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 595f02c09ee01b4b47098709c56b6a28bd06803cc6c8fa96bea246f23b8383d4
MD5 5b416b7212550561e3414cad7c8d3b4e
BLAKE2b-256 b78e4caf3ef1c419532d82cf228ac2d00b86763738113bb84ce1dd3866f3384e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mintalib-0.1.8-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.8-cp311-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 eb2160113cc13ad218a24dd75f4aa24df4ab9023e0e861e762048b996f3b8cf3
MD5 46d4530cf67b85c8bc074cf2ae329423
BLAKE2b-256 5537b5f40133eac07fd0a1319507a8a90d9f376f66ef5dd549fc188dddd84725

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

0.1.9

6 files

This release

0.1.8 This release

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