Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:TA Lib Ta lib python Get Functions API

From Leeroopedia
Revision as of 16:48, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/TA_Lib_Ta_lib_python_Get_Functions_API.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Knowledge Sources
Domains Technical_Analysis, Software_Architecture
Last Updated 2026-02-09 22:00 GMT

Overview

Concrete tool for enumerating all available TA-Lib indicator functions and their groups via get_functions() and get_function_groups() in the talib module.

Description

Two module-level functions provide indicator discovery:

  • talib.get_functions() — Returns a flat list of all 161 function names by iterating over the __function_groups__ dict.
  • talib.get_function_groups() — Returns a copy of the __function_groups__ dict, mapping group names to lists of function names.

The __function_groups__ dict is defined statically in talib/__init__.py with 10 group keys containing all 161 function names. The __TA_FUNCTION_NAMES__ list is generated by the Cython extension from TA-Lib C headers.

Usage

Use these functions for indicator discovery, batch processing, or building dynamic UIs.

Code Reference

Source Location

  • Repository: ta-lib-python
  • File: talib/__init__.py
  • Lines: L331-338 (get_functions), L340-345 (get_function_groups), L147-329 (__function_groups__ dict)

Signature

def get_functions() -> list[str]:
    """
    Returns a list of all the functions supported by TALIB.
    Returns 161 function names as uppercase strings.
    """

def get_function_groups() -> dict[str, list[str]]:
    """
    Returns a dict with keys of function-group names and values of lists
    of function names ie {'group_names': ['function_names']}
    Returns a copy of the internal __function_groups__ dict.
    """

Import

import talib
# or
from talib import get_functions, get_function_groups

I/O Contract

Inputs

Name Type Required Description
(none) Both functions take no parameters

Outputs

Name Type Description
get_functions() list[str] Flat list of 161 function names (e.g., ['ADX', 'ADXR', ..., 'WMA'])
get_function_groups() dict[str, list[str]] Dict mapping 10 group names to lists of function names

Usage Examples

List All Functions

import talib

all_funcs = talib.get_functions()
print(len(all_funcs))  # 161
print(all_funcs[:5])   # ['HT_DCPERIOD', 'HT_DCPHASE', 'HT_PHASOR', 'HT_SINE', 'HT_TRENDMODE']

List By Group

groups = talib.get_function_groups()
print(list(groups.keys()))
# ['Cycle Indicators', 'Math Operators', 'Math Transform',
#  'Momentum Indicators', 'Overlap Studies', 'Pattern Recognition',
#  'Price Transform', 'Statistic Functions', 'Volatility Indicators',
#  'Volume Indicators']

# Get all momentum indicators
momentum = groups['Momentum Indicators']
print(len(momentum))  # 31

Batch Computation

import numpy as np
from talib import abstract

close = np.random.random(100)
inputs = {'close': close}

# Compute all overlap studies
for name in talib.get_function_groups()['Overlap Studies']:
    try:
        func = abstract.Function(name)
        result = func.run(inputs)
        print(f"{name}: computed")
    except Exception as e:
        print(f"{name}: requires additional inputs")

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment