Skip to main content

Fastest zero-dependency pure-Python technical analysis library — full functional parity with ta.js 2.0

Project description

Technical Analysis (ta.py)

PyPI version Downloads License: MIT

A zero-dependency, pure-Python technical analysis library. 151 indicators, full type hints, and full functional parity with ta.js 2.0 — its sibling JavaScript library. No NumPy, no pandas, 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 pip works.
  • 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-ta doesn'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_py is auditable Python source. No prebuilt binaries, no setup.py running 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.

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, plus ta_py.random.* and ta_py.aroon.* namespaces.
  • Multi-process Monte Carlo via ta_py.multi.sim — typically 2–3× faster than the sequential ta_py.sim on 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 of rsi), stoch. See MIGRATION.md for before/after examples.
  • PEP 561 marker (py.typed) ships in the wheel so type-checkers pick up ta_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

Indicators

Oscillators

Bands

Statistics

Chart Types

Random

Miscellaneous

Experimental

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

MIT

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.


Project details


Download files

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

Source Distribution

ta_py-2.0.0.tar.gz (40.4 kB view details)

Uploaded Source

Built Distribution

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

ta_py-2.0.0-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file ta_py-2.0.0.tar.gz.

File metadata

  • Download URL: ta_py-2.0.0.tar.gz
  • Upload date:
  • Size: 40.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for ta_py-2.0.0.tar.gz
Algorithm Hash digest
SHA256 517d26298f06c41ce7b47f92a948c3de1b826c199e4a5bc5efaa1fe0093b205e
MD5 4d5bada59e35adec4401f262a6a6be43
BLAKE2b-256 6b06519665a2b768bc1b1dd785559c0dbe43d591f9b52146a309ebdafa189c1a

See more details on using hashes here.

File details

Details for the file ta_py-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: ta_py-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for ta_py-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b85fb97b28e6c34dec3e3ebb09158fd08446a34f01c6a5d72b0643e5e525dead
MD5 8c50c51dafb4ba7c8eec54ce2fbd6e8d
BLAKE2b-256 dce9ddcdd43954d26775467dcc72c143d825aafc569e26caf2de815acf9231bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page