Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
from pathlib import Path

import marimo
from fastapi import FastAPI, APIRouter
from fastapi import APIRouter, FastAPI
from fastapi.staticfiles import StaticFiles

APP_PATH = Path(__file__).parent
from app.utils.paths import APP_PATH, head_snippet

PORT = int(os.environ.get("MICRO_SERVICE_PORT", "8001"))
status_router = APIRouter()


def crate_app() -> FastAPI:
# Create a marimo asgi app
server = marimo.create_asgi_app(include_code=True)
html_head = head_snippet()
server = marimo.create_asgi_app(include_code=True, html_head=html_head)
for path in APP_PATH.glob("*.py"):
if path.name.startswith("_"):
continue
Expand All @@ -25,6 +27,7 @@ def crate_app() -> FastAPI:
app.mount("/", StaticFiles(directory=APP_PATH / "docs", html=True), name="static")
return app


@status_router.get("/status")
async def service_status() -> dict:
return {"status": "ok"}
Expand Down
File renamed without changes.
15 changes: 15 additions & 0 deletions app/utils/paths.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from pathlib import Path


APP_PATH = Path(__file__).parent.parent
DOCS_PATH = APP_PATH.parent / "docs"


def head_snippet() -> str:
return (DOCS_PATH / "assets" / "logos" / "head-snippet.html").read_text()


def on_post_page(output: str, page, config) -> str:
"""Hook to inject custom HTML into the head of each page in mkdocs build."""
snippet = head_snippet()
return output.replace("</head>", f"{snippet}</head>", 1)
30 changes: 30 additions & 0 deletions docs/assets/logos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Quantflow brand assets

## Files

- `quantflow-mark.svg` — symbol only, transparent background (use anywhere)
- `quantflow-mark-dark.svg` — symbol on deep navy (#0B0E14)
- `quantflow-app-icon.svg` — symbol in rounded square (PWA / iOS / Android)
- `quantflow-favicon.svg` — small-size favicon
- `quantflow-lockup.svg` — horizontal lockup (mark + "Quantflow"), transparent
- `quantflow-lockup-dark.svg` — same on deep navy
- `quantflow-lockup-tagline-dark.svg` — full lockup with tagline, dark
- `quantflow-lockup-tagline-light.svg` — full lockup with tagline, light
- `quantflow-linkedin-banner.svg` — 1584×396 social banner

## Colors

- **Olive / Gold** — `#A39410` — wordmark + anchor dot
- **Blue** — `#3B82F6` — decay dots + tagline
- **Deep navy** — `#0B0E14` — primary background
- **Tagline blue (light bg)** — `#1E40AF`

## Type

- Wordmark: **Inter, weight 400, capital Q**, letter-spacing −0.03em
- Tagline: **Inter, weight 400, regular tracking**

## Notes

- The SVGs reference Inter as a webfont. For pixel-perfect renders outside the browser (PDF / print), convert text to outlines in your editor — or load Inter (https://fonts.google.com/specimen/Inter) before rasterizing.
- The mark is built on a 100×100 grid: 3×3 dots, base radius 11, diagonal decay 1 → 0.35, top-left dot in olive.
Binary file added docs/assets/logos/favicon.ico
Binary file not shown.
12 changes: 12 additions & 0 deletions docs/assets/logos/head-snippet.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Place manifest at /assets/logos/manifest.json
SVGs at /assets/logos/, PNGs at /assets/logos/png/
Favicons use the DARK background versions for tab visibility -->
<link rel="icon" type="image/svg+xml" href="/assets/logos/quantflow-mark-dark.svg">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/logos/png/quantflow-mark-dark-16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/logos/png/quantflow-mark-dark-32.png">
<link rel="icon" type="image/png" sizes="48x48" href="/assets/logos/png/quantflow-mark-dark-48.png">
<link rel="icon" type="image/png" sizes="64x64" href="/assets/logos/png/quantflow-mark-dark-64.png">
<link rel="icon" type="image/png" sizes="128x128" href="/assets/logos/png/quantflow-mark-dark-128.png">
<link rel="apple-touch-icon" sizes="180x180" href="/assets/logos/png/quantflow-app-icon-256.png">
<link rel="manifest" href="/assets/logos/manifest.json">
<meta name="theme-color" content="#0B0E14">
42 changes: 42 additions & 0 deletions docs/assets/logos/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "Quantflow",
"short_name": "Quantflow",
"description": "A modern Python library for quantitative finance",
"icons": [
{
"src": "/assets/logos/quantflow-mark-dark.svg",
"sizes": "any",
"type": "image/svg+xml"
},
{
"src": "/assets/logos/png/quantflow-mark-dark-128.png",
"sizes": "128x128",
"type": "image/png"
},
{
"src": "/assets/logos/png/quantflow-mark-dark-256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "/assets/logos/png/quantflow-mark-dark-512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "/assets/logos/png/quantflow-app-icon-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/assets/logos/png/quantflow-app-icon-1024.png",
"sizes": "1024x1024",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#0B0E14",
"background_color": "#0B0E14",
"display": "standalone"
}
Binary file added docs/assets/logos/png/quantflow-app-icon-1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-app-icon-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-app-icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-lockup-1200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-dark-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-dark-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-dark-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-dark-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-dark-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-dark-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logos/png/quantflow-mark-dark-64.png
16 changes: 16 additions & 0 deletions docs/assets/logos/quantflow-app-icon.svg
13 changes: 13 additions & 0 deletions docs/assets/logos/quantflow-favicon.svg
18 changes: 18 additions & 0 deletions docs/assets/logos/quantflow-linkedin-banner.svg
15 changes: 15 additions & 0 deletions docs/assets/logos/quantflow-lockup-dark.svg
16 changes: 16 additions & 0 deletions docs/assets/logos/quantflow-lockup-tagline-dark.svg
15 changes: 15 additions & 0 deletions docs/assets/logos/quantflow-lockup-tagline-light.svg
14 changes: 14 additions & 0 deletions docs/assets/logos/quantflow-lockup.svg
14 changes: 14 additions & 0 deletions docs/assets/logos/quantflow-mark-dark.svg
13 changes: 13 additions & 0 deletions docs/assets/logos/quantflow-mark.svg
Binary file added docs/favicon.ico
Binary file not shown.
63 changes: 8 additions & 55 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,67 +29,20 @@ pip install quantflow

* `data` — data retrieval: `pip install quantflow[data]`
* `ai` — MCP server for AI clients: `pip install quantflow[ai,data]`
* `ml` — training the Deep Implied Volatility model: `pip install quantflow[ml]`

## 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.
Quantflow exposes its data tools as an [MCP](https://modelcontextprotocol.io) server for AI clients. See [MCP Server](mcp.md) for setup and available tools.

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

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

### API keys

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

```
fmp=your-fmp-key
fred=your-fred-key
```
Released under the [BSD 3-Clause License](https://github.com/quantmind/quantflow/blob/main/LICENSE).

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

### Claude Code
If you use Quantflow in your research, please cite it using the metadata in [CITATION.cff](https://github.com/quantmind/quantflow/blob/main/CITATION.cff).

```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"]
}
}
}
```
## License

### 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 |
Released under the [BSD 3-Clause License](https://github.com/quantmind/quantflow/blob/main/LICENSE).
Loading
Loading