Skip to main content

TaCuda — Python Bindings

Python package for the native tacuda CUDA library. Full TA-Lib coverage (161 functions): indicators, MACDEXT, 19 vector math kernels, candlestick patterns, plus typed core APIs with runtime dtype selection and the zero-copy device API.

Prerequisites

  • NVIDIA GPU (Compute Capability >= 6.0)
  • CUDA Toolkit 11.x or 12.x
  • Built tacuda shared library (tacuda.dll / libtacuda.so / libtacuda.dylib)
  • Python >= 3.8, NumPy >= 1.20

Package Scope

  • High-level NumPy wrappers for indicator functions
  • Precision-aware core indicators (sma, ema, rsi, macd, atr, bbands) via dtype="float16|float32|float64"
  • OHLCV convenience container and input validation helpers

Installation

pip install tacuda

Note: The tacuda native library must be built separately and placed where the Python bindings can find it. See "Library Location" below.

Quick Start

import numpy as np
from tacuda import sma, ema, rsi, macd, bbands, OHLCV

# Generate sample data
prices = np.random.randn(100_000).cumsum().astype(np.float32) + 100

# Moving averages
sma20 = sma(prices, 20)
ema12 = ema(prices, 12)

# RSI
rsi14 = rsi(prices, 14)

# MACD (returns macd_line, signal, histogram)
macd_line, signal, hist = macd(prices, 12, 26, 9)

# Bollinger Bands (returns upper, middle, lower)
upper, middle, lower = bbands(prices, 20, 2.0, 2.0)

# OHLCV container
ohlcv = OHLCV.from_columns(open_arr, high_arr, low_arr, close_arr, volume_arr)

MACDEXT and vector math

import tacuda

# Independent MA types per line (0=SMA 1=EMA 2=WMA ... 8=T3)
ext_macd, ext_signal, ext_hist = tacuda.macdext(
    prices, fastPeriod=12, fastType=1, slowPeriod=26, slowType=0,
    signalPeriod=9, signalType=2)

# Element-wise GPU kernels
log_prices = tacuda.ln(prices)
spread = tacuda.sub(high_arr, low_arr)

Zero-copy device pipeline

n = len(prices)
d_in = tacuda.device_alloc(n)
d_out = tacuda.device_alloc(n)
try:
    tacuda.device_upload(prices, d_in, n)   # 1 PCIe transfer in
    tacuda.sma_d(d_in, d_out, n, 20)        # compute on GPU
    tacuda.sin_d(d_out, d_out, n)           # chain kernels, zero copies
    tacuda.device_sync()
    result = tacuda.device_download(d_out, n)  # 1 PCIe transfer out
finally:
    tacuda.device_free(d_in)
    tacuda.device_free(d_out)

Available Indicators (full TA-Lib coverage)

Category Indicators
Moving Averages SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, T3, MAMA, MAVP, MA
Momentum RSI, MACD, MACDEXT, MACDFIX, Stochastic, StochF, StochRSI, CCI, CMO, ROC, ROCP, ROCR, ROCR100, MOM, WILLR, APO, PPO, PVO, TRIX, ULTOSC, BOP
Volatility ATR, NATR, TRANGE, BBANDS, ACCBANDS, StdDev, VAR
Trend ADX, ADXR, DX, +DI, -DI, +DM, -DM, SAR, SAREXT, Aroon, AroonOsc
Volume AD, ADOSC, OBV, MFI, IMI, NVI, PVI
Statistical LINEARREG, SLOPE, INTERCEPT, ANGLE, TSF, CORREL, BETA, AVGDEV, SUM, MAX, MIN
Price Transform AVGPRICE, MEDPRICE, TYPPRICE, WCLPRICE, MIDPRICE
Hilbert Transform HT_DCPERIOD, HT_DCPHASE, HT_PHASOR, HT_SINE, HT_TRENDLINE, HT_TRENDMODE
Vector Math (19) SIN, COS, TAN, ASIN, ACOS, ATAN, SINH, COSH, TANH, EXP, LN, LOG10, SQRT, CEIL, FLOOR, ADD, SUB, MULT, DIV
Candlestick 63 patterns (Doji, Hammer, Engulfing, MorningStar, etc.)
Device API ct_*_d variants of the above + device_alloc/upload/download/sync/free and buffer-pool controls

Library Location

The bindings search for the native library in this order:

  1. TACUDA_LIBRARY environment variable (full path to shared library)
  2. TACUDA_LIBRARY_PATH / TACUDA_LIBRARY_DIR + library name
  3. System library path (ctypes.util.find_library)
  4. Common build directories relative to the package

Regenerating Metadata

When the C header changes, regenerate from the repository root:

python bindings/generate_bindings.py

Build & Publish (PyPI)

cd bindings/python
python -m build
python -m twine check dist/*
python -m twine upload dist/*

Changelog

Canonical release history is maintained in CHANGELOG.md.

License

Apache License 2.0 — see LICENSE.

Metadata

Release files for tacuda 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tacuda 0.7.1
File Size Uploaded Provenance
tacuda-0.7.1.tar.gz 32.3 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for tacuda 0.7.1
File Interpreter ABI Platform
tacuda-0.7.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
tacuda-0.7.1-py3-none-manylinux_2_35_x86_64.whl Python 3 none Linux glibc 2.35+ x86-64 Details

Total release size: 33.6 MB

Release files / tacuda-0.7.1.tar.gz

Download URL tacuda-0.7.1.tar.gz
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5291ef71b1246eaa6162a63b748f4300d9e6bcf8110156654f730ffb49d19fe9
BLAKE2b-256 checksum
How to use checksums
dd85a8cb47ae3899b60a6f875f3f03ff94f5752787c8f6d7a6a1325c49ece211
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / tacuda-0.7.1-py3-none-win_amd64.whl

Download URL tacuda-0.7.1-py3-none-win_amd64.whl
Size 28.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
44e32efdf55cff03c886e411e260f3efbd40d8e742f1c07c11fdd2659fa816a2
BLAKE2b-256 checksum
How to use checksums
196d4fc56c19c4670a73479911da20becdfc63a49b059ca58648d070cc88a6a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / tacuda-0.7.1-py3-none-manylinux_2_35_x86_64.whl

Download URL tacuda-0.7.1-py3-none-manylinux_2_35_x86_64.whl
Size 5.5 MB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
6f50f7f9016bbddbab701f1543f26a773366df86b4f3a7344a61d5463bd5cc1b
BLAKE2b-256 checksum
How to use checksums
11553ef80d767923beb0779a95db270531ab659fd0461cb423508d8b8eab591f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for tacuda 0.7.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.7.1 This release

3 release files No provenance

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