Skip to main content

TA-Lib reimplemented in pure Python + Numba.

Project description

numbatalib

Reimplement TA-Lib (technical analysis indicators) in pure Python + Numba, aiming for:

  • algorithmic parity with the local installed talib (ground-truth reference for tests/benchmarks)
  • near-C performance for large vectors (Numba JIT)
  • no compiled extension at install time (no libta-lib dependency)

Status

  • Implemented TA-Lib Core functions: 161 / 161
  • Parity tests: generated/pytest_results.txt
  • Parity + benchmark results: generated/parity_results.csv, generated/bench_results.csv
  • Status tracker: port_checklist.csv

Note: the local talib wheel in this environment does not expose ACCBANDS, AVGDEV, IMI; those are validated against upstream TA-Lib C (see generated/parity_results_upstream_c.csv).

Install

After publishing to PyPI:

pip install numbatalib

Usage

numbatalib exposes TA-Lib function names dynamically:

import numpy as np
import numbatalib as ta

x = np.random.default_rng(0).normal(size=1000).cumsum()

sma = ta.SMA(x, timeperiod=20)
rsi = ta.RSI(x, timeperiod=14)

TA-Lib compatible API (minimal habit cost)

If you want talib-like APIs + error messages, use the compatibility shim:

import numpy as np
import numbatalib.talib as talib  # or: import numbatalib.compat.talib as talib

x = np.random.default_rng(0).normal(size=1000).cumsum()

talib.SMA(x, timeperiod=20)
talib.stream.SMA(x, timeperiod=20)        # streaming scalar
from numbatalib.talib import abstract
abstract.Function("SMA")(x, timeperiod=20)

Notes:

  • set_compatibility/get_compatibility and set_unstable_period/get_unstable_period are supported (matching TA-Lib behavior for EMA/RSI/CMO and unstable-period masking).

Dev

  • Run parity tests vs installed talib: pytest -q
  • Regenerate parity + speed CSVs and update checklist: python tools/compare_vs_talib.py --bench --write-checklist

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

numbatalib-0.1.0.tar.gz (63.8 kB view details)

Uploaded Source

Built Distribution

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

numbatalib-0.1.0-py3-none-any.whl (167.2 kB view details)

Uploaded Python 3

File details

Details for the file numbatalib-0.1.0.tar.gz.

File metadata

  • Download URL: numbatalib-0.1.0.tar.gz
  • Upload date:
  • Size: 63.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for numbatalib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6b972c04206b2e8b0c506c0ee47373b5e9b6958ddca0286c41ef61e533f89e52
MD5 85cc7f16dc8f7ca800fbfd60b8464c90
BLAKE2b-256 ce71c768fcbc3d6999dfa502eaab88823252a4879684034b95968650e3baefd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for numbatalib-0.1.0.tar.gz:

Publisher: publish.yml on bluesHeart/numbatalib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numbatalib-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: numbatalib-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 167.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for numbatalib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04990741fb76d760d38e7d654504fcf895b7899541efd0c8ef73a984430220ef
MD5 dc456cdc7c10df7cdcbc11a4a8f68130
BLAKE2b-256 ebbf5748ae3bcbdc7d2f172e50d139118910f860a4ab4fcea6374f3746cc7fbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for numbatalib-0.1.0-py3-none-any.whl:

Publisher: publish.yml on bluesHeart/numbatalib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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