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.0.tar.gz (9.2 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.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pandas_ti-1.0.0.tar.gz
  • Upload date:
  • Size: 9.2 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.0.tar.gz
Algorithm Hash digest
SHA256 16d0f05e15dc6f584041982c6b400206d426125db0f024dfcb33ebb694b8ec11
MD5 bc7ffc46207bf70c09392418e46c1ce1
BLAKE2b-256 184b6a9b0d6791f01176eecc319c02d7e66348307d78b02c0eec4d99df77912e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pandas_ti-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39d8afe14f8b43d58091bad98133e2f785d574fcdd5f110d06567077e715b6e4
MD5 4efaaf25cb30b0dbf2d406c7d7ef6999
BLAKE2b-256 7c3311f5e860595cde6db4d13923dfe5f2a32df4ac9b264fb9d3f4290939105f

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