Commit Graph

15 Commits

Author SHA1 Message Date
f9ebee042a chore: gitignore STATUS.md (personal /wrap resume brief) 2026-06-29 15:53:36 -04:00
5c8e0f11f3 Add README Quickstart with prerequisites; update author email
- README: add a 5-minute Quickstart with a Python 3.9+ prerequisites
  block (OS-specific python3/pip notes + venv step for PEP-668 systems)
- pyproject: set author email to david.boyd1@dc.gov

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 14:54:39 -04:00
74ba9fe781 Ignore Gitea grant-sync script/log; refresh unemployment report
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:44:00 -04:00
e18f3cf1f2 Ignore local Gitea credential files
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:10:59 -04:00
8f0122011a Add project overview & usage guide (docs/BLS_Library_Overview.md)
Narrative of the audit/repair work plus a practical usage guide for the
client, query helpers, series builders, QCEW module, caching/errors/retry,
testing, and coverage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 10:51:57 -04:00
0d0d6dabe2 Add transient-network retry with exponential backoff
- bls_client/retry.py: with_retries() retries timeouts/connection drops and
  429/5xx with exponential backoff; honors Retry-After; never retries 4xx or
  BLSQuotaError (those won't fix themselves)
- BLSClient(retries=2, backoff=0.5) wraps the data POST and discovery GETs;
  qcew CSV fetch wrapped too. retries=0 disables.
- tests/test_retry.py: 6 offline tests (injectable sleep, no real delays)
- README: retry behavior documented; drop the now-resolved limitation

Offline suite 125 passing; live smoke green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 10:49:18 -04:00
9e2c55c568 Add QCEW CSV module, ECEC breakdown, response caching + typed errors
Item 1 — QCEW county/industry detail:
- new bls_client/qcew.py: thin client over the QCEW Open Data CSV service
  (area/industry/size slices; no API key, no quota), with filter_rows helper
- covers the county/industry detail the timeseries API can't reach

Item 2 — ECEC benefit breakdown:
- new series.ecec() builder from the authoritative cm.estimate decode table
- real helpers: wages, total benefits, paid leave, supplemental pay,
  health insurance, retirement & savings, legally required + ecec_dashboard()
- FIX: ecec_total_benefits was CMU1036... (education/health industries only);
  correct all-civilian total benefits is CMU1030000000000D

Item 3 — caching + typed errors:
- bls_client/cache.py FileCache (on-disk, TTL); BLSClient(cache=True),
  queries_used counter (cache hits don't spend quota)
- bls_client/errors.py: BLSError / BLSQuotaError / BLSRequestError; quota
  exhaustion now raises a clear BLSQuotaError instead of a generic RuntimeError

Tests: 119 offline (+24) incl. ECEC goldens, QCEW fixture parse, cache/quota
behavior; live smoke extended to ECEC + QCEW. Helper sweep: 96/96 live.
README: caching/QCEW usage, updated coverage + limitations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 10:38:12 -04:00
881d62cf32 Add pyproject.toml packaging and pytest suite
- pyproject.toml: setuptools build, deps (requests), dev extra (pytest),
  pytest config with opt-in `live` marker
- tests/: 95 offline tests locking every series-ID encoding against
  known-good IDs (regression guard for the JOLTS/OES/ECI/productivity/QCEW
  fixes), plus a live API smoke test behind `-m live`
- README: install-as-package + test instructions; drop the now-resolved
  "no packaging"/"no tests" limitations
- gitignore build/test artifacts

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 09:53:37 -04:00
4fe734381e 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>
2026-06-22 09:45:27 -04:00
20bd3e9a2f Add BLS client library, example scripts, and usage docs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 08:39:47 -04:00
eb724aa7ff Add BLS dataset explorer — all 68 surveys with example queries
Self-contained HTML reference covering all BLS surveys organized by category:
Employment, Prices, Wages, Productivity, Safety, Consumer/Household, Other.
Each card shows survey description, example series ID, latest data point,
collapsible Python query snippet, and active/discontinued status.
19 of 42 active surveys return live data via the API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 12:25:17 -04:00
0242977abe Add Baltimore/Richmond MSAs and employment level chart
- Added Baltimore-Columbia-Towson MSA (CBSA 12580) and Richmond MSA (CBSA 40060)
- Now covers 6 geographies: DC, MD, VA states + DC/Baltimore/Richmond MSAs
- Added second Chart.js line chart showing employment levels over 24 months
- Cards grid updated to 3-column layout (2 rows of 3)
- Y-axis auto-formats to K/M for employment chart

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 11:43:25 -04:00
ae46e429a8 Embed Chart.js inline — report is now fully self-contained
No internet connection required to open dc_md_va_unemployment_report.html.
chart.umd.min.js (200 KB) is bundled into the HTML at generation time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 11:34:25 -04:00
fd9491f869 Add static HTML report generator with Chart.js charts
Generates dc_md_va_unemployment_report.html: 4 stat cards (DC/MD/VA/DC MSA),
24-month unemployment rate trend line chart, and current-month summary table.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 11:18:02 -04:00
2b9d3e6d68 Initial BLS data reference and DC/MD/VA unemployment dashboard
Includes:
- API v1/v2 documentation, endpoints, request/response schemas
- Complete survey catalog (60 surveys, live-fetched from API)
- Series ID decode tables: LAUS, CES, SM, QCEW, OES, JOLTS, CPI, PPI
- QCEW quarterly (47 fields) and annual (43 fields) CSV schemas
- dc_md_va_unemployment.py: pulls 16 LAUS series for DC/MD/VA + DC MSA
- Example API response and 5-year CSV output

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 11:03:14 -04:00