download_data()

Download a quarter’s FCA Call Report archive and unzip into dest.

Usage

Source

download_data(
    year,
    month,
    dest,
    files=None,
    quiet=False,
)

The files in the S3 bucket are identical to those published by FCA, with one exception: the RCR7 data files in the March, June, September and December 2024 archives have been corrected to add rows that are missing from FCA’s versions. Without these rows, process_data() fails on the 2024 data. See https://github.com/ketchbrookanalytics/fcall/issues/23 for details. If you need FCA’s original 2024 files, download them directly from the FCA website.

Parameters

year: int

Four-digit year (e.g. 2025).

month: int | str

Month name (e.g. "September") or integer (e.g. 9). Valid quarters are 3, 6, 9, 12.

dest: str | Path

Directory to extract files into (created if it does not exist).

files: list[str] | None = None

Optional list of file names to extract; None extracts all.

quiet: bool = False
Suppress progress messages when True.

Returns

bool
True if the data was successfully downloaded and unzipped. If the data cannot be downloaded (e.g., there is no internet connection, the resource is unavailable, or there is no data for the requested year and month) or unzipped, an informative message is printed to stderr and False is returned instead of raising.

Raises

ValueError

If year or month is invalid.

KeyError
If a name in files is not in the archive.