Metadata-Version: 2.5
Name: eod-market-data
Version: 0.1.0
Summary: Canonical EOD market-data CSV time-series store, exchange-calendar awareness, split-boundary guards, and pluggable multi-source price/FX/rate feeds
Project-URL: Homepage, https://github.com/benjamin-di/eod-market-data
Project-URL: Issues, https://github.com/benjamin-di/eod-market-data/issues
Author: benjamin-di
License-Expression: MIT
License-File: LICENSE
Keywords: eod,exchange-calendars,finance,fx,market-data,treasury,twelvedata,yfinance
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: exchange-calendars<5,>=4.5
Requires-Dist: pandas<3.1,>=2.2
Requires-Dist: pyyaml<7,>=6
Requires-Dist: requests<3,>=2.32
Requires-Dist: yfinance<2,>=0.2.50
Description-Content-Type: text/markdown

# eod-market-data

Canonical EOD market-data CSV time-series store, exchange-calendar awareness, split-boundary guards, and pluggable multi-source price/FX/rate feeds for Python.

## Features

- **Canonical long-format CSV store** (`store`): One tidy table (`Date`, `ISIN`, `Ticker`, `Bloomberg`, `Name`, `Asset class`, `Currency`, `Close local`, `FX EUR/Local`, `Close EUR`, `Volume`, `Source`, `Price basis`) with atomic writes, idempotent `upsert_series(..., replace_other_sources=False)`, and `series_matrix()` views.
- **Multi-venue exchange calendars** (`calendar`): Holiday- and DST-aware session resolution via `exchange-calendars` (including custom `XATH` Euronext Athens registration and STOXX dissemination calendar) so US holidays never stall European listings and vice versa.
- **Split-boundary guards** (`splits`): Parses `; split event <k>` annotations and computes cumulative split divisors while keeping raw closes unadjusted and reproducible.
- **Official & keyed EOD feeds** (`providers`):
  - `yfinance`: equities, ETFs, FX fallback, dividends, and split detection.
  - `twelvedata`: true EOD FX primary (`EUR/USD`, etc.), US equity gap-fill, and 17:00 `America/New_York` XAU/USD spot gold.
  - `alphavantage`: throttled, budget-capped non-US/US equity gap-fill.
  - `lse`: dated native London closes from the public LSE instrument JSON endpoint (`lastclose`/`lastclosedate`, GBX→GBP normalization, ISIN/SEDOL verification).
  - `exchange_closes`: config-driven Nasdaq historical JSON and HKEX Daily Quotations gap-fill.
  - `treasury`: official US Treasury daily par-yield curve CSV.
- **Extensible plugin protocol** (`providers.base.GapFillProvider`): Register custom or private venue feeds without modifying the core library.
- **Config-driven universe** (`universe`): Load securities, FX pairs, and LSE/exchange mappings from `universe.yaml` (see [examples/universe.yaml](examples/universe.yaml)).

## Installation

```bash
pip install eod-market-data
```

Or with `uv`:

```bash
uv add eod-market-data
```

## Quick start

```python
from pathlib import Path
from eod_market_data import calendar, store, universe

cfg = universe.load_universe(Path("examples/universe.yaml"))
df = store.read_history_df(Path("market-data-history.csv"))
print("Expected XNYS session:", calendar.expected_session_for("XNYS"))
```

### CLI

```bash
# Inspect an existing CSV store
eod-data inspect --store market-data-history.csv

# Fetch latest US Treasury par-yield curve
eod-data treasury

# Fetch 17:00 New York XAU/USD spot gold (requires TWELVEDATA_API_KEY)
eod-data gold-spot --store market-data-history.csv

# Prepare an append-only FX backfill CSV
eod-data backfill-fx --source market-data-history.csv --out candidate.csv --currency JPY --start 2026-01-01 --end 2026-01-31
```

## License

MIT — see [LICENSE](LICENSE).
