Technical Analysis for Python — ta.py
A zero-dependency technical analysis library for Python — 151 indicators (RSI, MACD, ATR, Bollinger Bands, ADX, Stochastics, VWAP, Ichimoku, CCI, Keltner, SuperTrend and more) implemented in pure Python, with full type hints and full functional parity with ta.js 2.0 — its sibling JavaScript library. No NumPy, no pandas, no TA-Lib, no C extensions, no compilers required.
NOTE
ta_py runs anywhere CPython does. There is nothing to compile and nothing to vendor — pip install ta_py is the entire installation.
from ta_py import sma, rsi
sma([1, 2, 3, 4, 5, 6, 10], 6) # [3.5, 5]
The only multi-process feature is ta_py.multi.sim (Monte Carlo via stdlib multiprocessing); it falls back to the sequential ta_py.sim automatically when run inside an environment that can't spawn workers.
Install
pip install ta_py
Requires Python 3.10 or newer. No other runtime dependencies.
Usage
import ta_py as ta
ta.sma([1, 2, 3, 4, 5, 6, 10], 6) # [3.5, 5]
ta.aroon.up([5, 4, 5, 2], 3) # [100.0, 50.0]
ta.bands([1, 2, 3, 4, 5, 6], length=5, deviations=2)
Or import individual functions:
from ta_py import rsi, macd, atr, bands
Every function is also re-exported on the top-level ta_py module. The ta_py.aroon, ta_py.random, and ta_py.multi namespaces mirror their ta.js counterparts.
Why pure Python?
ta_py is the only TA library on PyPI that combines zero runtime dependencies, full pure-Python implementation, and full ta.js 2.0 indicator coverage. That combination matters when:
- Install pain is a deal-breaker. No C compiler, no system libraries, no platform-specific wheels. Works on Alpine containers, AWS Lambda, locked-down corporate Python builds, fresh Windows installs — anywhere
pipworks. - Footprint matters. A few hundred KB on disk vs. ~50–100 MB for
numpy+pandas. Important for serverless cold starts, container images, and edge deploys. - You're chasing the latest CPython. Pure-Python libraries ship the day a new Python release does. C/Cython libraries lag months —
pandas-tadoesn't yet support Python 3.14, and TA-Lib regularly delays wheels for new interpreters. - You can't or won't add native dependencies. Compliance reviews, supply-chain audits, vendoring requirements: every line of
ta_pyis auditable Python source. No prebuilt binaries, nosetup.pyrunning compilers. - You target alternative runtimes. PyPy, GraalPy, and Pyodide (Python in the browser via WASM) all run pure-Python code. Most native-extension TA libraries don't port.
If you need raw throughput across millions of bars in tight loops and you're comfortable installing a C extension, use TA-Lib. ta_py exists for the much larger case where indicator math is one step in a bigger pipeline and "fast enough on a 10k-bar series, with no install pain" is the right trade.
How ta.py compares
| Library | Runtime dependencies | Native code | Install |
|---|---|---|---|
| ta.py | none | none | pip install ta_py |
| TA-Lib | libta-lib (C) + Python wrapper | yes | Python package plus the native library, or a prebuilt wheel |
| pandas-ta | numpy, pandas | none | pip install pandas-ta (pulls ~50–100 MB) |
| finta | numpy, pandas | none | pip install finta (pulls ~50–100 MB) |
Pick TA-Lib if you need maximum throughput over millions of bars in tight loops and can install a C extension. Pick ta.py if you want indicator math to be one step in a larger pipeline, on any interpreter, with nothing to compile or audit.
Performance notes
Internal sliding-window O(N) rewrites in 2.0 measurably beat naïve list-comprehension implementations of the same indicators (e.g. Bollinger Bands ~5× faster than a textbook Python implementation, standard deviation ~13× faster). The bench/ sub-project contains a regression-tracking harness used during development; it is not a marketing benchmark and does not claim parity with C-backed libraries.
What's new in 2.0.0
- 39 new indicators for full ta.js 2.0 parity: DM family (
pdm/mdm/pdi/mdi/dx/adx/adxr/natr),cci,stoch_rsi,kdj,cmf,vortex,kvo,ult,trix,ppo,apo,mass,dema/tema/trima/t3/zlema/vidya, linear regression family (lr_slope/lr_intercept/lr_angle/tsf),std_series,adl,nvi/pvi,emv,dpo,ulcer,fibnumbers, plusta_py.random.*andta_py.aroon.*namespaces. - Multi-process Monte Carlo via
ta_py.multi.sim— typically 2–3× faster than the sequentialta_py.simon 8-core hardware. - Sliding-window O(N) rewrites of hot paths:
std,bands,sma,smma,wma,ema,vwma,variance,envelope,mfi,rsi,stoch,pr,don. - 6 algorithm/output-shape breaks vs 1.17.0 —
atr,smma,mfi,rsi,wrsi(now an alias ofrsi),stoch. See MIGRATION.md for before/after examples. - PEP 561 marker (
py.typed) ships in the wheel so type-checkers pick upta_py's annotations automatically.
See CHANGELOG.md for the full per-batch breakdown.
Examples
Per-indicator usage with input/output samples lives in EXAMPLES.md.
Moving Averages
- SMA · SMMA · WMA · EMA · DEMA · TEMA · TRIMA · T3 · ZLEMA · VIDYA · Hull · LSMA · VWMA · VWWMA · WSMA · PWMA · HWMA · KAMA · CWMA
Indicators
- MACD · MACD signal · MACD bars · RSI · Wilder's RSI · TSI · BOP · Force Index · ASI · Alligator · Williams %R · Stochastics · Stoch RSI · Fibonacci Retracement · Bollinger Bandwidth · Ichimoku · ATR · NATR · Aroon Up · Aroon Down · Aroon namespace · MFI · CMF · ROC · Coppock · KST · OBV · NVI · PVI · ADL · EMV · VWAP · Fractals · Crossover · Momentum · HalfTrend · ZigZag · PSAR · SuperTrend · Elder Ray · HV · RVI · RVI signal · RSI Divergence · Universal Divergence · TRIX · CCI · DM family · DI family · DX · ADX · ADXR · PPO · APO · DPO · Mass Index · Ulcer Index · Vortex · KDJ · KVO
Oscillators
- Alligator Osc · Chande Momentum · Chaikin · Aroon Osc · Awesome · Accelerator · Fisher · Ultimate
Bands
Statistics
- Std · Std series · LR slope · LR intercept · LR angle · TSF · Variance · Normal CDF · Inverse Normal · Monte Carlo · Multi-process Monte Carlo · Percentile · Correlation · Covariance · Pct Difference · Expected Return · Abnormal Return · Kelly · Permutations · Winratio · Avg Win · Avg Loss · Drawdown · Median · Recent High · Recent Low · MAD · AAD · Std Error · SSD · Log · Exp · Normalize · Denormalize · Normalize Pair · Normalize From · Standardize · Z-Score · K-means · MSE · Cumulative · Sum · Return Positive · Return Negative · P-Value · Martingale · Anti-Martingale · Expected Trails
Chart Types
Random
Miscellaneous
Experimental
FAQ
Is there a technical analysis library for Python that doesn't need pandas or NumPy?
Yes — that is exactly what ta.py is. It has zero runtime dependencies and is implemented entirely in pure Python, so pip install ta_py pulls nothing else down with it.
How is ta.py different from TA-Lib?
TA-Lib is a C library with a thin Python wrapper, so it needs the native libta-lib present (or a matching prebuilt wheel) and its wheels lag new CPython releases. ta.py is pure Python: one wheel, no native artifacts, and it runs on CPython 3.10+ as well as PyPy, GraalPy and Pyodide. TA-Lib is still the faster option for millions of bars in a tight loop — see How ta.py compares.
Can I use ta.py with pandas DataFrames?
Convert the column to a plain sequence first: ta.rsi(df["close"].tolist(), 14). Every function takes an ordinary Python sequence and returns a list, and ta.py deliberately never imports pandas — that independence is the point of the library.
Does ta.py work on AWS Lambda, Alpine containers and other minimal images?
Yes. There is nothing to compile and no system library to install, so it works anywhere pip does, including musl-based images and serverless cold-start budgets. The one multi-process feature, ta_py.multi.sim, falls back to the sequential ta_py.sim automatically when workers can't be spawned.
Is ta.py fast enough for backtesting?
For typical backtests over thousands of bars, yes — 2.0 rewrote the hot paths (sma, ema, wma, rsi, stoch, bands, variance, and others) as O(N) sliding-window passes. If you are optimizing millions of bars in tight loops, use a C-backed library instead.
How many indicators does ta.py have, and are they tested?
151, matching ta.js 2.0 function-for-function across moving averages, indicators, oscillators, bands, statistics, chart types and Monte Carlo simulation. The test suite covers them at 1e-12 tolerance.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to change. Please update tests as appropriate — see CONTRIBUTING.md for the test/lint workflow.
License
Maintained By
ta.py is an open-source project created and actively maintained by Nino Kroesen.
This library was built with portability in mind for high-frequency data and algorithmic trading systems where install footprint, dependency surface, and supply-chain auditability matter as much as raw throughput. If you'd like to see these indicators in action within a live quantitative trading environment, check out Bitvested.
Metadata
Release files for ta_py 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ta_py-2.1.0.tar.gz | 54.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ta_py-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 94.9 kB
Release files / ta_py-2.1.0.tar.gz
| Download URL | ta_py-2.1.0.tar.gz |
|---|---|
| Size | 54.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a62848c25fe4d764144a6fa029393be4c4e24b8568ab446c7d0314769a10a9cd
|
|
BLAKE2b-256 checksum How to use checksums |
8f21577bb0306739e58d77ee63eb46b9fb76b56f8600dc40d701d0c274f44afe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / ta_py-2.1.0-py3-none-any.whl
| Download URL | ta_py-2.1.0-py3-none-any.whl |
|---|---|
| Size | 40.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d48126d7539cba81ab12c123063a827cc75df2e3793e2ab4be955a99af04e78
|
|
BLAKE2b-256 checksum How to use checksums |
f1a2e16a02681782cf08fa4046fb0a48f639840f2dd9edff3b2ff76cec3741e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|