Metadata-Version: 2.5
Name: portfolio-overview
Version: 0.4.0
Summary: Data-contract, base-currency-agnostic multi-custodian portfolio valuation, performance, risk, bond analytics, and Excel workbook engine
Project-URL: Homepage, https://github.com/benjamin-di/portfolio-overview
Project-URL: Issues, https://github.com/benjamin-di/portfolio-overview/issues
Author: benjamin-di
License-Expression: MIT
License-File: LICENSE
Keywords: accounting,expected-shortfall,finance,ibkr,openpyxl,portfolio,twr,valuation,var
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.11
Requires-Dist: eod-market-data<1,>=0.1.0
Requires-Dist: fhs-market-risk<1,>=0.1.0
Requires-Dist: ibkr-flex-accounting<1,>=0.1.0
Requires-Dist: openpyxl<4,>=3.1
Requires-Dist: pandas<3.1,>=2.2
Requires-Dist: portfolio-twr<1,>=0.2.0
Requires-Dist: pyyaml<7,>=6
Provides-Extra: bonds
Requires-Dist: callable-bond-analytics<1,>=0.1.0; extra == 'bonds'
Description-Content-Type: text/markdown

# portfolio-overview

Data-contract, base-currency-agnostic multi-custodian portfolio valuation, performance, risk, bond analytics, and Excel workbook engine.

`portfolio-overview` composes five standalone financial libraries into a deterministic, zero-network functional core:

- [`eod-market-data`](https://pypi.org/project/eod-market-data/) — canonical EOD price/FX time-series store and calendar guards
- [`ibkr-flex-accounting`](https://pypi.org/project/ibkr-flex-accounting/) — optional Interactive Brokers Flex XML accounting snapshots
- [`fhs-market-risk`](https://pypi.org/project/fhs-market-risk/) — EWMA Filtered Historical Simulation VaR/ES, walk-forward backtesting, and FX sensitivity
- [`portfolio-twr`](https://pypi.org/project/portfolio-twr/) — linked daily TWR, geometric contribution attribution, drawdown/Sharpe/Sortino, and Modified Dietz
- [`callable-bond-analytics`](https://pypi.org/project/callable-bond-analytics/) (optional `[bonds]` extra) — QuantLib callable/perpetual bond YTC, YTP/YTW, Modified Duration, and DV01

## Architecture

No plugin registries or global state: every boundary is an immutable, versioned data contract.

```text
YAML / CSV / IBKR Flex XML (or your private bank ETL)
        │
        ▼
  PortfolioBook  (typed input IR, schema_version = 1)
        │
        ▼
  evaluate(book)  (pure functional core, zero network IO)
        │
        ▼
  PortfolioReport (typed output IR, base-currency-agnostic JSON)
        │
        ├──▶ render_workbook(report, out.xlsx)
        └──▶ Your downstream consumers (private bank controls, email, MCP)
```

## Installation

```bash
pip install portfolio-overview
# With QuantLib callable/AT1 bond analytics:
pip install "portfolio-overview[bonds]"
```

## Quick Start

```bash
# 1. Scaffold a starter portfolio (or run on examples/demo-portfolio)
portfolio-overview init ./my-portfolio

# 2. Fetch EOD security prices & FX pairs into market-history.csv (Yahoo Finance)
portfolio-overview fetch ./my-portfolio

# 3. Validate & build JSON report + Excel workbook (zero network IO)
portfolio-overview validate ./my-portfolio
portfolio-overview build ./my-portfolio --out ./out
```

Or from Python:

```python
from pathlib import Path
from portfolio_overview import evaluate, load_book, render_workbook

book = load_book(Path("examples/demo-portfolio"))
report = evaluate(book)
print(f"NAV ({report.base_currency}): {report.nav:,.2f}")
render_workbook(report, Path("out/portfolio-overview.xlsx"))
```

## License

MIT — see [LICENSE](LICENSE).
