← 返回
未分类 中文

FRED Data Viz

Create publication-ready economic comparison charts from Federal Reserve Economic Data (FRED). Use when the user needs to visualize, compare, or analyze econ...
用于在用户需要可视化、比较或分析经济数据时,根据美联储经济数据(FRED)生成可直接发布的对比图表。
pratyushchauhan
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 1
Stars
📥 119
下载
💾 0
安装
1
版本
#latest

概述

FRED Data Visualization

Create indexed comparison charts from Federal Reserve Economic Data (FRED) series.

Quick Start

For a simple two-series comparison:

python3 scripts/fred_chart.py --config chart_config.json --output chart.png

Workflow

1. Identify the FRED series

Find series IDs at fred.stlouisfed.org:

IndicatorCommon Series
------
Real GDPGDPC1
GDP Per CapitaA939RX0Q048SBEA (or compute from GDPC1 + POPTHM)
Compensation Per HourCOMPRNFB
Median Weekly EarningsLES1252881600Q
Corporate ProfitsCP
CPICPIAUCSL
UnemploymentUNRATE

2. Create config JSON

{
  "title": "USA: GDP vs Wages (1959 = 100)",
  "series": [
    {
      "id": "A939RX0Q048SBEA",
      "label": "Real GDP Per Capita",
      "color": "#2E86AB"
    },
    {
      "id": "COMPRNFB",
      "label": "Real Compensation Per Hour",
      "color": "#F18F01"
    }
  ],
  "start_date": "1959-01-01",
  "end_date": "2026-12-31",
  "fill_gap": true,
  "annotations": [
    {
      "date": "1971-08-15",
      "label": "Nixon Shock",
      "position": "top",
      "y": 140
    }
  ]
}

Config fields:

  • title: Chart title
  • series[].id: FRED series ID
  • series[].label: Legend label
  • series[].color: Optional hex color
  • start_date/end_date: Date range filter
  • fill_gap: Shade area between first two series (default: true)
  • annotations[].date: Event date (YYYY-MM-DD)
  • annotations[].label: Event text (supports newlines with \n)
  • annotations[].position: "top" or "bottom"
  • annotations[].y: Vertical position for label placement

3. Generate chart

python3 scripts/fred_chart.py --config my_chart.json --output my_chart.png

Advanced: GDP Per Capita Calculation

When FRED lacks a direct GDP per capita series, compute it from GDP (GDPC1) and population (POPTHM):

# gdp_pc = (GDP in billions * 1e9) / (Population in thousands * 1e3)
# Or use the pre-computed series: A939RX0Q048SBEA (available from 1979)
# For earlier dates, manual calculation required

Tips

  • Indexing: All series are automatically indexed to their first observation (set to 100) for fair comparison
  • Annotations: Use \n for multi-line labels. Position alternates top/bottom to avoid overlap
  • Zooming: Use start_date/end_date to focus on specific eras (e.g., 1959-1985)
  • Colors: Choose contrasting colors. Blue (#2E86AB) and orange (#F18F01) work well
  • Multiple series: Up to 5 series supported. Gap fill only applies to first two

Common Chart Patterns

PatternSeriesUse Case
---------
Productivity-Pay GapA939RX0Q048SBEA, COMPRNFBShow worker compensation vs economic output
Wage-Inflation ComparisonCES0500000003, CPIAUCSLReal vs nominal wage growth
Profit-Wage DivergenceCP, COMPRNFBWhere surplus goes
Historical EventsAny + annotationsAnnotated economic timeline

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-06-04 14:04

安全检测

腾讯云安全 (Keen)

队列中

腾讯云安全 (Sanbu)

队列中

🔗 相关推荐

Conversation Video

pratyushchauhan
Generate animated conversation videos with multi-voice TTS audio and timed text overlays. Use when the user needs to (1)
★ 0 📥 88

Remotion Animator

pratyushchauhan
一种面向智能体的视频技能,使用 Remotion 编程方式构建动画视频,适用于制作各类动画(如片头、解释视频)时。
★ 0 📥 133

Supertonic TTS

pratyushchauhan
使用Supertonic (Supertone)在设备上进行多语言文字转语音。适用于需要本地/离线TTS、语音生成、语音合成或转换的场景。
★ 2 📥 380