# futuresharks/financial-data architecture

> Architecture diagram of the GitHub repository futuresharks/financial-data, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/futuresharks/financial-data
- Repository: https://github.com/futuresharks/financial-data

## Overview

pyfinancialdata is a bundled intraday financial-data library. The main workflow is a caller selecting provider, instrument, and year through the public API; the loader reads the matching bundled CSV format, normalizes and optionally resamples/prices the rows, and returns a Pandas DataFrame. A multi-year API combines yearly results. Separately, an Oanda utility can fetch candles, convert them to a DataFrame, and optionally save CSV. The source excerpts show these runtime paths; the README documents the dataset families and supported instruments.

Main entry points: [`pyfinancialdata/get.py`](https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/get.py) (Year Loader), [`pyfinancialdata/oanda_prices.py`](https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/oanda_prices.py) (Monthly Fetch), [`pyfinancialdata/__init__.py`](https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/__init__.py) (Package API), [`pyfinancialdata/data/currencies/oanda`](https://github.com/futuresharks/financial-data/tree/master/pyfinancialdata/data/currencies/oanda) (Oanda CSV Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Python API"]
  node_public["Package API<br/>[__init__.py]"]
  node_loader["Year Loader<br/>[get.py]"]
  node_multi["Multi-year Loader<br/>[get.py]"]
end

subgraph group_datasets["Bundled Datasets"]
  node_oanda_store[("Oanda CSV Data")]
  node_histdata_store[("Histdata CSV Data")]
  node_bitstamp_store[("Bitstamp CSV Data")]
  node_kraken_store[("Kraken CSV Data")]
end

subgraph group_oanda["Oanda Ingestion"]
  node_oanda_account["Oanda Account<br/>[oanda_prices.py]"]
  node_candle_frame["Candle Converter<br/>[oanda_prices.py]"]
  node_oanda_fetch["Monthly Fetch<br/>[oanda_prices.py]"]
end

node_caller(("Data User"))
node_oanda_service{{"Oanda API"}}
node_csv_output["CSV Output"]

node_caller -->|"imports"| node_public
node_public -->|"re-exports"| node_loader
node_caller -->|"requests data"| node_loader
node_caller -->|"requests years"| node_multi
node_loader -->|"reads CSVs"| node_oanda_store
node_loader -->|"reads CSV"| node_histdata_store
node_loader -->|"reads CSV"| node_bitstamp_store
node_loader -->|"reads CSV"| node_kraken_store
node_multi -->|"loads each year"| node_loader
node_oanda_fetch -->|"requests candles"| node_oanda_account
node_oanda_account -->|"calls candles API"| node_oanda_service
node_oanda_fetch -->|"normalizes candles"| node_candle_frame
node_oanda_fetch -->|"writes CSV"| node_csv_output

click node_public "https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/__init__.py"
click node_loader "https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/get.py"
click node_multi "https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/get.py"
click node_oanda_store "https://github.com/futuresharks/financial-data/tree/master/pyfinancialdata/data/currencies/oanda"
click node_histdata_store "https://github.com/futuresharks/financial-data/tree/master/pyfinancialdata/data/stocks/histdata"
click node_bitstamp_store "https://github.com/futuresharks/financial-data/tree/master/pyfinancialdata/data/cryptocurrencies/bitstamp"
click node_kraken_store "https://github.com/futuresharks/financial-data/tree/master/pyfinancialdata/data/cryptocurrencies/kraken"
click node_oanda_account "https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/oanda_prices.py"
click node_candle_frame "https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/oanda_prices.py"
click node_oanda_fetch "https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/oanda_prices.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_public,node_loader,node_multi,node_caller toneBlue
class node_oanda_store,node_histdata_store,node_bitstamp_store,node_kraken_store toneAmber
class node_oanda_account,node_candle_frame,node_oanda_fetch,node_oanda_service toneMint
class node_csv_output toneIndigo
```

## Components

### Python API

- [Package API](https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/__init__.py): `pyfinancialdata/__init__.py`
- [Year Loader](https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/get.py): `pyfinancialdata/get.py`
- [Multi-year Loader](https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/get.py): `pyfinancialdata/get.py`

### Bundled Datasets

- [Oanda CSV Data](https://github.com/futuresharks/financial-data/tree/master/pyfinancialdata/data/currencies/oanda): `pyfinancialdata/data/currencies/oanda`
- [Histdata CSV Data](https://github.com/futuresharks/financial-data/tree/master/pyfinancialdata/data/stocks/histdata): `pyfinancialdata/data/stocks/histdata`
- [Bitstamp CSV Data](https://github.com/futuresharks/financial-data/tree/master/pyfinancialdata/data/cryptocurrencies/bitstamp): `pyfinancialdata/data/cryptocurrencies/bitstamp`
- [Kraken CSV Data](https://github.com/futuresharks/financial-data/tree/master/pyfinancialdata/data/cryptocurrencies/kraken): `pyfinancialdata/data/cryptocurrencies/kraken`

### Oanda Ingestion

- [Oanda Account](https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/oanda_prices.py): `pyfinancialdata/oanda_prices.py`
- [Candle Converter](https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/oanda_prices.py): `pyfinancialdata/oanda_prices.py`
- [Monthly Fetch](https://github.com/futuresharks/financial-data/blob/master/pyfinancialdata/oanda_prices.py): `pyfinancialdata/oanda_prices.py`

### Other components

- **Data User**
- **Oanda API**
- **CSV Output**

## Connections

- Data User → Package API: imports (evidence: `README.md`)
- Package API → Year Loader: re-exports (evidence: `pyfinancialdata/__init__.py`)
- Data User → Year Loader: requests data (evidence: `README.md`)
- Data User → Multi-year Loader: requests years (evidence: `README.md`)
- Year Loader → Oanda CSV Data: reads CSVs (evidence: `pyfinancialdata/get.py`)
- Year Loader → Histdata CSV Data: reads CSV (evidence: `pyfinancialdata/get.py`)
- Year Loader → Bitstamp CSV Data: reads CSV (evidence: `pyfinancialdata/get.py`)
- Year Loader → Kraken CSV Data: reads CSV (evidence: `pyfinancialdata/get.py`)
- Multi-year Loader → Year Loader: loads each year (evidence: `pyfinancialdata/get.py`)
- Monthly Fetch → Oanda Account: requests candles (evidence: `pyfinancialdata/oanda_prices.py`)
- Oanda Account → Oanda API: calls candles API (evidence: `pyfinancialdata/oanda_prices.py`)
- Monthly Fetch → Candle Converter: normalizes candles (evidence: `pyfinancialdata/oanda_prices.py`)
- Monthly Fetch → CSV Output: writes CSV (evidence: `pyfinancialdata/oanda_prices.py`)
