Skip to main content

Comprehensive financial Exploratory Data Analysis for price series and tickers

Project description

fin-eda

Comprehensive financial Exploratory Data Analysis for any stock ticker or price series. Produces a rich, colour-coded tearsheet covering returns, risk, drawdowns, benchmark comparison, volatility, liquidity, and more — all in one call.

Installation

pip install fin-eda

Quick Start

from fin_eda import eda

# Fetch data automatically via yfinance
eda("AAPL")

# Custom date range
eda("MSFT", start="2020-01-01", end="2024-01-01")

# Custom period
eda("TSLA", period="5y")

# Different benchmark
eda("QQQ", benchmark_ticker="SPY")

# Include a risk-free rate
eda("AAPL", risk_free_rate=0.05)

# Pass your own price series
import pandas as pd
prices = pd.Series(...)
eda(prices, benchmark_ticker="SPY")

# Return results as a dict (no print)
results = eda("AAPL", return_results=True, quiet=True)

Output

The tearsheet is rendered in the terminal using Rich with colour-coded values (green = positive/good, yellow = neutral, red = negative/risk).

A header panel shows the current trend snapshot, followed by one table per section.

Metrics Covered

Section Key Metrics
Core Return & Risk Cumulative return, arithmetic & geometric mean, median, std dev, annualized volatility & variance — across 1M, 3M, 6M, 1Y, 3Y, 5Y, 10Y, YTD
Risk-Adjusted Performance Sharpe ratio, Sortino ratio, downside deviation, semi-variance, profit factor — from 6M+
Drawdown & Capital Destruction Max drawdown, average drawdown, time to recovery, max consecutive loss days — from 3M+
Trend Structure & Price Health 50/100/200D moving averages, price vs 200D MA, golden/death cross spread, trend persistence, 52W high distance
Relative Performance vs Benchmark Excess return, information ratio — from 6M+
Beta, Correlation & Market Dependence Beta, correlation vs benchmark — from 3M+
Capture Ratios Up-market and down-market capture (annualized) — from 6M+
Return Distribution & Non-Normality Skewness, kurtosis, Jarque-Bera statistic — from 3M+
Tail Risk & Stress Historical VaR (95% & 99%), Expected Shortfall/CVaR, worst daily/weekly/monthly return, extreme loss frequency
Regime & Time-Series Behavior Return autocorrelation at 1D, 5D, 21D lags
Volatility Metrics Parkinson volatility (21D/63D/126D), rolling vol percentile, volatility of volatility, current vs 1Y vol ratio
Liquidity Metrics Average daily volume (30D/90D), volume trend, Amihud illiquidity ratio (30D/90D/full)

Parameters

Parameter Type Default Description
ticker_or_prices str or pd.Series Yahoo Finance ticker or a Series of close prices
benchmark_ticker str 'SPY' Benchmark symbol. Pass None to skip
risk_free_rate float 0.0 Annual risk-free rate (e.g. 0.05 for 5%)
period str '10y' yfinance history period (ignored if start/end provided)
start str None Start date YYYY-MM-DD
end str None End date YYYY-MM-DD
return_results bool False Return the metrics dict instead of printing
quiet bool False Suppress all printed output

Dependencies

License

MIT

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

fin_eda-1.0.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

fin_eda-1.0.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fin_eda-1.0.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for fin_eda-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5e8636e37b079d040036d484f19fd454bf4f3dd66b3a135e8462faa650423e75
MD5 78450070acc5f2012f6b982d0a60971b
BLAKE2b-256 2e3da0a9991e5fce2369b0ea0ea1680468c42c2a519109938085cd395485f89a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fin_eda-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for fin_eda-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d77605536d2d3cc952c6a73402b2e1a0ef8cd4165a4b309d4ef4bbc6167cac15
MD5 90479cd611f5ee0f432a1e0a82f430bc
BLAKE2b-256 fadae5c28c6df6eb2985562e87f5ab784804d8ae8a1993520b18e83896825e3d

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