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-libdependency)
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_compatibilityandset_unstable_period/get_unstable_periodare 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b972c04206b2e8b0c506c0ee47373b5e9b6958ddca0286c41ef61e533f89e52
|
|
| MD5 |
85cc7f16dc8f7ca800fbfd60b8464c90
|
|
| BLAKE2b-256 |
ce71c768fcbc3d6999dfa502eaab88823252a4879684034b95968650e3baefd3
|
Provenance
The following attestation bundles were made for numbatalib-0.1.0.tar.gz:
Publisher:
publish.yml on bluesHeart/numbatalib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
numbatalib-0.1.0.tar.gz -
Subject digest:
6b972c04206b2e8b0c506c0ee47373b5e9b6958ddca0286c41ef61e533f89e52 - Sigstore transparency entry: 869763190
- Sigstore integration time:
-
Permalink:
bluesHeart/numbatalib@06449661065ac9c86acf924007767ffebe2f2bc2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bluesHeart
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@06449661065ac9c86acf924007767ffebe2f2bc2 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04990741fb76d760d38e7d654504fcf895b7899541efd0c8ef73a984430220ef
|
|
| MD5 |
dc456cdc7c10df7cdcbc11a4a8f68130
|
|
| BLAKE2b-256 |
ebbf5748ae3bcbdc7d2f172e50d139118910f860a4ab4fcea6374f3746cc7fbc
|
Provenance
The following attestation bundles were made for numbatalib-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on bluesHeart/numbatalib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
numbatalib-0.1.0-py3-none-any.whl -
Subject digest:
04990741fb76d760d38e7d654504fcf895b7899541efd0c8ef73a984430220ef - Sigstore transparency entry: 869763198
- Sigstore integration time:
-
Permalink:
bluesHeart/numbatalib@06449661065ac9c86acf924007767ffebe2f2bc2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bluesHeart
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@06449661065ac9c86acf924007767ffebe2f2bc2 -
Trigger Event:
workflow_dispatch
-
Statement type: