Fix broken series-ID builders; env-var config; project README

Repair every dead series-ID encoding (library now 82/82 query helpers
return live data, verified against the BLS API):

- JOLTS: 21-char format (was 18) — add state/area/sizeclass fields
- OES: national area code 0000000 (was invalid 0000400)
- ECI: correct owner/component/estimate encoding, default unadjusted (CIU)
- Productivity: 4-digit sector + 4-digit measure codes (was 2+3)
- QCEW: 13-char timeseries-API form (ENUUS00010510 / ENU{fips}00010{own}10)
- PPI: repoint finished-goods -> final demand (WPUFD4); keep alias
- ECEC: drop fabricated health-insurance/retirement helpers; add total benefits
- wages SOC: software developers 151132 -> 151252 (2018 SOC)

Tooling/docs:
- config reads BLS_API_KEY env var (takes precedence; config.py gitignored)
- add requirements.txt
- rewrite README as project front door + coverage table + limitations
- correct JOLTS/OES tables in series_id_formats.md, USAGE.md, dataset explorer

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-22 09:45:27 -04:00
parent 20bd3e9a2f
commit 4fe734381e
10 changed files with 246 additions and 245 deletions

View File

@ -113,21 +113,27 @@ def jolts_dashboard() -> dict:
# QCEW
# ---------------------------------------------------------------------------
def qcew_national_private() -> str:
"""QCEW — national, private sector, all industries, quarterly."""
return "ENU0000010510000"
"""QCEW — national, private sector, all industries (monthly employment)."""
return "ENUUS00010510"
def qcew_dc_private() -> str:
"""QCEW — DC, private sector, all industries."""
return "ENU1100010510000"
return qcew_state(11, "5")
def qcew_state(state_fips: int, ownership: str = "5") -> str:
"""
QCEW state-level series.
Format: EN + U + area(5: 2-digit FIPS + "000") + datatype "1" + size "0"
+ ownership(1) + industry "10" (total, all industries) = 13 chars.
Args:
state_fips: 2-digit FIPS
state_fips: 2-digit FIPS (e.g. 11=DC)
ownership: "0"=all, "5"=private, "1"=federal, "2"=state, "3"=local
Note: BLS serves the full QCEW catalog (county/industry detail) through its
dedicated QCEW Open Data API, not the timeseries API used here.
"""
return f"ENU{state_fips:02d}0001{ownership}10000"
return f"ENU{state_fips:02d}00010{ownership}10"