Metadata-Version: 2.4
Name: quantflow
Version: 0.6.0
Summary: quantitative analysis
Project-URL: Homepage, https://github.com/quantmind/quantflow
Project-URL: Repository, https://github.com/quantmind/quantflow
Project-URL: Documentation, https://quantmind.github.io/quantflow/
Author-email: Luca Sbardella <luca@quantmind.com>
License-Expression: BSD-3-Clause
License-File: LICENSE
Requires-Python: <3.15,>=3.11
Requires-Dist: ccy>=1.7.1
Requires-Dist: polars[pandas,pyarrow]>=1.11.0
Requires-Dist: pydantic>=2.0.2
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: scipy>=1.14.1
Requires-Dist: statsmodels<0.15.0,>=0.14.6
Provides-Extra: ai
Requires-Dist: asciichartpy>=1.5.25; extra == 'ai'
Requires-Dist: ccy[holidays]>=1.7.1; extra == 'ai'
Requires-Dist: google-genai>=1.61.0; extra == 'ai'
Requires-Dist: mcp>=1.26.0; extra == 'ai'
Requires-Dist: openai>=2.16.0; extra == 'ai'
Requires-Dist: pydantic-ai-slim>=1.51.0; extra == 'ai'
Requires-Dist: rich>=13.9.4; extra == 'ai'
Provides-Extra: book
Requires-Dist: altair>=6.0.0; extra == 'book'
Requires-Dist: autodocsumm>=0.2.14; extra == 'book'
Requires-Dist: duckdb>=1.4.4; extra == 'book'
Requires-Dist: fastapi>=0.129.0; extra == 'book'
Requires-Dist: marimo>=0.19.7; extra == 'book'
Requires-Dist: plotly>=6.2.0; extra == 'book'
Requires-Dist: sympy>=1.12; extra == 'book'
Provides-Extra: data
Requires-Dist: aio-fluid[http]>=1.2.1; extra == 'data'
Provides-Extra: dev
Requires-Dist: black>=26.3.1; extra == 'dev'
Requires-Dist: ghp-import>=2.0.2; extra == 'dev'
Requires-Dist: isort>=8.0.0; extra == 'dev'
Requires-Dist: mypy>=1.14.1; extra == 'dev'
Requires-Dist: pytest-asyncio>=1.0.0; extra == 'dev'
Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.15.4; extra == 'dev'
Requires-Dist: types-python-dateutil>=2.9.0.20251115; extra == 'dev'
Provides-Extra: docs
Requires-Dist: griffe-pydantic>=1.1.0; extra == 'docs'
Requires-Dist: griffe-typingdoc>=0.2.7; extra == 'docs'
Requires-Dist: mkdocs-macros-plugin>=1.3.7; extra == 'docs'
Requires-Dist: mkdocs-material>=9.7.0; extra == 'docs'
Requires-Dist: mkdocs-redirects>=1.2.1; extra == 'docs'
Requires-Dist: mkdocstrings[python]==1.0.0; extra == 'docs'
Provides-Extra: ml
Requires-Dist: torch>=2.10.0; extra == 'ml'
Description-Content-Type: text/markdown

# <a href="https://quantmind.github.io/quantflow"><img src="https://raw.githubusercontent.com/quantmind/quantflow/main/docs/assets/quantflow-light.svg" width=300 /></a>

[![PyPI version](https://badge.fury.io/py/quantflow.svg)](https://badge.fury.io/py/quantflow)
[![Python versions](https://img.shields.io/pypi/pyversions/quantflow.svg)](https://pypi.org/project/quantflow)
[![Python downloads](https://img.shields.io/pypi/dd/quantflow.svg)](https://pypi.org/project/quantflow)
[![build](https://github.com/quantmind/quantflow/actions/workflows/build.yml/badge.svg)](https://github.com/quantmind/quantflow/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/quantmind/quantflow/branch/main/graph/badge.svg?token=wkH9lYKOWP)](https://codecov.io/gh/quantmind/quantflow)

Quantitative analysis and pricing tools.

![btcvol](https://github.com/quantmind/quantflow/assets/144320/88ed85d1-c3c5-489c-ac07-21b036593214)

## Installation

```bash
pip install quantflow
```

## Modules

* [quantflow.ai](https://github.com/quantmind/quantflow/tree/main/quantflow/ai) MCP server for AI clients (requires `quantflow[ai,data]`)
* [quantflow.data](https://github.com/quantmind/quantflow/tree/main/quantflow/data) data APIs (requires `quantflow[data]`)
* [quantflow.options](https://github.com/quantmind/quantflow/tree/main/quantflow/options) option pricing and calibration
* [quantflow.sp](https://github.com/quantmind/quantflow/tree/main/quantflow/sp) stochastic process primitives
* [quantflow.ta](https://github.com/quantmind/quantflow/tree/main/quantflow/ta) timeseries analysis tools
* [quantflow.utils](https://github.com/quantmind/quantflow/tree/main/quantflow/utils) utilities and helpers

## Optional dependencies

* `data` — data retrieval: `pip install quantflow[data]`
* `ai` — MCP server for AI clients: `pip install quantflow[ai,data]`

## MCP Server

Quantflow exposes its data tools as an [MCP](https://modelcontextprotocol.io) server, allowing AI clients such as Claude to query market data, crypto volatility surfaces, and economic indicators directly.

Install with the `ai` and `data` extras:

```bash
pip install quantflow[ai,data]
```

### API keys

Store your API keys in `~/.quantflow/.vault`:

```
fmp=your-fmp-key
fred=your-fred-key
```

Or let the AI manage them for you via the `vault_add` tool once connected.

### Claude Code

```bash
claude mcp add quantflow -- uv run qf-mcp
```

### Claude Desktop

Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):

```json
{
  "mcpServers": {
    "quantflow": {
      "command": "uv",
      "args": ["run", "qf-mcp"]
    }
  }
}
```

### Available tools

| Tool | Description |
|---|---|
| `vault_keys` | List stored API keys |
| `vault_add` | Add or update an API key |
| `vault_delete` | Delete an API key |
| `stock_indices` | List stock market indices |
| `stock_search` | Search companies by name or symbol |
| `stock_profile` | Get company profile |
| `stock_prices` | Get OHLC price history |
| `sector_performance` | Sector performance and PE ratios |
| `crypto_instruments` | List Deribit instruments |
| `crypto_historical_volatility` | Historical volatility from Deribit |
| `crypto_term_structure` | Volatility term structure |
| `crypto_implied_volatility` | Implied volatility surface |
| `crypto_prices` | Crypto OHLC price history |
| `ascii_chart` | ASCII chart for any stock or crypto symbol |
| `fred_subcategories` | Browse FRED categories |
| `fred_series` | List series in a FRED category |
| `fred_data` | Fetch FRED observations |
