Skip to content

Project-raw Compustat

These files standardize the two Compustat vendor extracts before derived variables are created.

flowchart LR
    annual_in[(Compustat annual CSV)] --> clean[Lowercase and deduplicate]
    quarterly_in[(Compustat quarterly CSV)] --> clean
    clean --> annual_out[(Project-raw annual Compustat)]
    clean --> quarterly_out[(Project-raw quarterly Compustat)]

    classDef source fill:#e8eef7,stroke:#52739e
    classDef process fill:#fff0cc,stroke:#a66b00
    classDef data fill:#e2f2e7,stroke:#3b7a4b
    class annual_in,quarterly_in source
    class clean process
    class annual_out,quarterly_out data
Dataset Grain and key Location
Annual gvkey, fiscal year /data/full/raw/compustat_annual.csv
Quarterly gvkey, statement date /data/full/raw/compustat_quarterly.csv

Builder: shared/data/build_raw_compustat.py

The builder lowercases and trims column names and keeps the first row for each primary key. It does not derive financial measures. These persisted staging files feed the processed Compustat builder and are not intended as downstream analysis inputs.

python shared/data/build_raw_compustat.py