Metadata-Version: 2.4
Name: metapyle
Version: 0.1.1
Summary: Unified interface for querying financial time-series data
Author-email: Stabile Frisur <26568863+stabilefrisur@users.noreply.github.com>
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: pandas>=2.0.0
Requires-Dist: pyyaml>=6.0
Provides-Extra: bloomberg
Requires-Dist: xbbg>=0.6.0; extra == 'bloomberg'
Provides-Extra: dev
Requires-Dist: mypy>=1.19.1; extra == 'dev'
Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.15.1; extra == 'dev'
Requires-Dist: pytest>=9.0.2; extra == 'dev'
Requires-Dist: ruff>=0.14.10; extra == 'dev'
Provides-Extra: macrobond
Requires-Dist: macrobond-data-api>=0.1.0; extra == 'macrobond'
Description-Content-Type: text/markdown

# Metapyle

[![PyPI](https://img.shields.io/pypi/v/metapyle)](https://pypi.org/project/metapyle/)
[![Python](https://img.shields.io/pypi/pyversions/metapyle)](https://pypi.org/project/metapyle/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

> **Early-stage research framework** — Not for production use.

A unified interface for querying financial time-series data from multiple sources.

Requires Python 3.12+

## Overview

Financial data lives in many places—Bloomberg terminals, internal APIs, CSV exports—each with its own ticker syntax, authentication, and quirks. Metapyle provides a YAML-based catalog that maps human-readable names to source-specific details, giving you a single `client.get()` interface regardless of where the data comes from.

Currently supports Bloomberg (via xbbg), Macrobond (via macrobond-data-api), and local files (CSV/Parquet).

## Installation

```bash
uv add metapyle[bloomberg]
```

Or with pip:

```bash
pip install metapyle[bloomberg]
```

For Macrobond support:

```bash
pip install metapyle[macrobond]
```

> **Note:** Bloomberg requires a Bloomberg Terminal. Macrobond requires desktop app or API credentials.

## Quick Start

**1. Create a catalog file (`catalog.yaml`):**

```yaml
- my_name: sp500_close
  source: bloomberg
  symbol: SPX Index
  field: PX_LAST

- my_name: gdp_us
  source: localfile
  symbol: GDP_US          # column name in the file
  path: /data/macro.csv   # file path
```

**2. Query data:**

```python
from metapyle import Client

with Client(catalog="catalog.yaml") as client:
    # end defaults to today
    df = client.get(["sp500_close"], start="2024-01-01")
```

## Documentation

See the [User Guide](docs/user-guide.md) for complete documentation, including:

- Catalog configuration
- Frequency alignment
- Caching
- Available data sources
- Error handling

## License

MIT License - see [LICENSE](LICENSE) for details.
