Research scripts only; not investment advice. Prefer re-running scripts over hand-editing parquet. Idempotent: re-download skips validated cached ZIPs; the in-repository notebook regenerates aggregate results.

Repository layout

tracks/y9c-panel/
  README.md
  requirements.txt
  core_items.yaml
  y9c/                          # download, panel, forecast modules
  scripts/                      # thin command-line entry points
  notebooks/y9c_nii_forecast.ipynb
  tests/
  data/raw/                     # ignored runtime ZIP cache
  data/processed/               # ignored panel and coverage outputs
docs/tracks/y9c-panel/results/   # generated aggregate results

1. FR Y-9C (NIC bulk)

Official source: NIC Financial Data Download

Scripted ZIP URL pattern (no auth):

https://www.ffiec.gov/npw/FinancialReport/ReturnBHCFZipFiles?zipfilename=BHCF{YYYYMMDD}.zip

Example: BHCF20241231.zip → one ^-delimited BHCF20241231.txt (latin-1). Chicago Fed historical page still lists older quarters but redirects current window to NIC. This pipeline uses NIC only.

Refresh: 2018Q1 through the latest available quarter

make y9c-venv
make y9c-data

From the repository root, make y9c also executes the notebook and renders the results page. The pipeline lives in tracks/y9c-panel/; see its README and code.

Outputs under tracks/y9c-panel/data/processed/:

The small tracks/y9c-panel/core_items.yaml corrects the reference mapping: BHCK4074 is net interest income, BHCK4107 total interest income and BHCK4073 total interest expense. Income items are de-cumulated only when the immediately prior quarter in the same calendar year is present. Values are thousands of USD. Raw data and panels stay in the ignored runtime cache.

Manual fallback

If NIC returns a redirect, HTML, or a captcha, the downloader fails clearly for required quarters:

  1. Open the NIC download page and download the named BHCF*.zip.
  2. Drop it into tracks/y9c-panel/data/raw/.
  3. Rerun make y9c-data.

2. Yahoo bank quarterly

Historical off-repository notes only; the pipeline and results in this repository use FR Y-9C alone.

cd /workspace/research/forma_adhoc
source .venv/bin/activate

python scripts/yahoo_bank_quarterly.py --write-csv
# or custom list:
python scripts/yahoo_bank_quarterly.py --tickers JPM,BAC,WFC --write-csv

Outputs under yahoo_bank_quarterly/processed/:

Seed tickers: yahoo_bank_quarterly/tickers/seed_us_banks.txt.

Alignment limits (YTD vs quarterly, labels ≠ MDRM): see yahoo_bank_quarterly/YAHOO_VS_Y9C.md.

Known quirks

Historical Yahoo environment (off-repository)

source /workspace/research/forma_adhoc/.venv/bin/activate
# already has: pandas pyarrow requests yfinance pyyaml tqdm

Related tracks