us-labor-cpi-data-pullerslisted
Install: claude install-skill sguri003/US_Labor_CPI
# US_Labor_CPI data pullers
## Overview
GDS Data Solutions project pulling US economic/labor data (BLS, BEA, EIA) into CSVs for analysis. Location: `US_Labor_CPI/US_Labor_CPI/`. Open source: github.com/sguri003/Labor_Stats_Dev.
## Folder layout (as of 2026-08-09 reorg)
- `scripts/` — all Python code, including a shared `paths.py` (`PROJECT_ROOT`, `DATA_DIR`, `SECRETS_DIR`, resolved via `Path(__file__)` so it works regardless of invocation cwd). Every script imports what it needs from `paths` rather than using bare filenames.
- `data_exports/` — all CSV/output data (pull results, generated frames, charts). Anything a puller writes goes here via `DATA_DIR`.
- `secrets/` — `API_KEY.csv` only. Gitignored (`secrets/` as a whole, per [[feedback_gitignore_secrets_proactively]]). Read via `SECRETS_DIR`.
- Loose reference files (`states.json`, `new_states.json`, `state_format.json`) stay at the project root — not exports, not secrets — referenced via `PROJECT_ROOT` from `dict_qa.py`.
## Puller class pattern
One class per data source, one file per class:
- Constructor: `(reg_key, out_file_nm, series_id/params, start_year, end_year)` — kicks off the pull and write in `__init__`.
- `get_*` method: fires the HTTP request. **Always check `status_code` before parsing the body** — BLS/EIA return HTML error/maintenance pages on non-200, and `json.loads()` on that raises a confusing `JSONDecodeError` instead of a clear cause. Pattern:
```python
if resp.status_code != 200:
raise Ru