Skip to main content

A lightweight technical indicators library for pandas DataFrames and Series

Project description

pandas_ti

PyPI version Python 3.12+ License: MIT

A lightweight and extensible technical analysis library for pandas DataFrames and Series.

Features

  • Zero Configuration - Automatic OHLCV column detection with multiple naming conventions
  • Pandas Native - Seamless integration via .ti accessor for DataFrames and Series
  • Self-Documenting - Built-in help system with rich console output
  • Extensible - Easy to add custom indicators with decorator pattern
  • Fast & Lightweight - Minimal dependencies, maximum performance

Quick Start

Installation

pip install pandas-ti

Basic Usage

import pandas as pd
import pandas_ti
import yfinance as yf

# Get some market data
df = yf.Ticker("AAPL").history(period="1y")

# DataFrame indicators - automatic OHLCV detection
df['atr_14'] = df.ti.ATR(n=14)
df['rtr'] = df.ti.RTR()

# Series indicators - work on any Series
df['sma_20'] = df['Close'].ti.SMA(n=20)
df['ema_50'] = df['Close'].ti.EMA(n=50)

Built-in Help System

# List all available indicators
df.ti.indicators()

# Get detailed help for specific indicator
df.ti.help('ATR')

# Series indicators help
df['Close'].ti.help('SMA')

Available Indicators

DataFrame Indicators (require OHLCV data)

Indicator Description Parameters
TR True Range None
ATR Average True Range n (window size)
RTR Relative True Range (normalized) None
ARTR Average Relative True Range n (window size)
SRTR Standardized Relative True Range n, N=1000, expand=True, method='cluster', full=False

Series Indicators (work on any Series)

Indicator Description Parameters
SMA Simple Moving Average n (window size)
EMA Exponential Moving Average n (span)

Custom Column Names

The library automatically detects OHLCV columns regardless of naming convention:

# All these DataFrames work automatically
df_yahoo = yf.Ticker("AAPL").history(period="1mo")  # Capital case: Open, High, Low, Close
df_crypto = ...  # lowercase: open, high, low, close
df_custom = ...  # Short form: O, H, L, C

# All work the same way
df_yahoo['atr'] = df_yahoo.ti.ATR(n=14)
df_crypto['atr'] = df_crypto.ti.ATR(n=14)
df_custom['atr'] = df_custom.ti.ATR(n=14)

Technical Details

Automatic Column Detection

The library automatically detects OHLCV columns using common naming variations:

Column Type Accepted Names
Open Open, OPEN, open, O, o
High High, HIGH, high, H, h
Low Low, LOW, low, L, l
Close Close, CLOSE, close, C, c
Volume Volume, VOLUME, volume, Vol, vol, V, v

Requirements

Core Dependencies

  • Python >= 3.12
  • pandas >= 2.3.3
  • numpy >= 2.3.3
  • rich >= 14.2.0
  • scipy >= 1.16.2
  • statsmodels >= 0.14.5

Optional dependencies

  • yfinance >= 0.2.66 (for examples and testing)
  • matplotlib >= 3.10.7 (for visualization)
  • mplfinance >= 0.12.10b0 (for financial charts)

Development

# Clone the repository
git clone https://github.com/JavierCalzadaEspuny/pandas-ti
cd pandas_ti

# Install in development mode
pip install -e .[dev]

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Javier Calzada Espuny

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

pandas_ti-1.0.1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

pandas_ti-1.0.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file pandas_ti-1.0.1.tar.gz.

File metadata

  • Download URL: pandas_ti-1.0.1.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pandas_ti-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d1c070f3726bfb1b70934db0dcd18815778642c297bf6704de3e49a515619985
MD5 d7f38180c3d99965ce97d0e29ef74487
BLAKE2b-256 6672cb89fef1277238ce481e7a721ceeed63636c27cbaf83e1845ab7da92e846

See more details on using hashes here.

File details

Details for the file pandas_ti-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pandas_ti-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pandas_ti-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e24e5301493f571b0da42e3bd2f0b8f891b1e4b73ac493342159a394e88b2a8f
MD5 73575213ec118dab293f6fad57fcde02
BLAKE2b-256 22e924254fe2b2aba4057e0366fd5f514237ab66250c6541d58e622a2e633dfb

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