◉CLAUDE LABJP
●CC 2.1.330 — Claude Code 2.1.330 fixes the multi-minute freeze right after compacting a long conversation●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 8 days left. The suggested replacement is claude-sonnet-5-5●MCP 401 — Users report MCP servers that return 401 time out silently instead of showing an error●NEW — New: Desktop creates a worktree for every session? Three places to check●OPUS 4.5 — The 11/24 date for Opus 4.5 is a not-sooner-than floor, not a retirement notice●SCHEMA — Same schema, different shape: compare structured output from the Agent SDK and the Messages API●CC 2.1.330 — Claude Code 2.1.330 fixes the multi-minute freeze right after compacting a long conversation●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 8 days left. The suggested replacement is claude-sonnet-5-5●MCP 401 — Users report MCP servers that return 401 time out silently instead of showing an error●NEW — New: Desktop creates a worktree for every session? Three places to check●OPUS 4.5 — The 11/24 date for Opus 4.5 is a not-sooner-than floor, not a retirement notice●SCHEMA — Same schema, different shape: compare structured output from the Agent SDK and the Messages API
Articles/Cowork
◈ Cowork/2026-04-15Intermediate

Cowork × Python Data Analysis Automation: Build a Weekly Report Pipeline with pandas and Matplotlib

Learn how to combine Cowork's scheduled tasks with Python to fully automate your data analysis reports. From pandas aggregation to Matplotlib charts and Google Sheets integration — a complete, production-ready implementation guide.

cowork16python23data analysisautomation110pandasmatplotlibscheduled tasks13report generation

✦ Premium Article

Every Monday morning, the same ritual: open the CSV, build a pivot table, copy the chart into a slide deck, send it to the team. Sound familiar?

Nearly all of that work can be automated with Cowork and Python. Imagine opening Slack on Monday morning to find last week's KPI report already waiting — generated while you slept. That's what this guide builds.

This is not a Python basics tutorial. It's a practical design guide for building a production-grade data pipeline by combining Cowork's scheduled tasks, bash environment, and Claude AI's analytical capabilities.

Why Automate Data Analysis in Cowork?

"If you know Python, just set up a cron job on a server" — that's a fair point. But Cowork offers something cron doesn't: native Claude AI integration.

For pure aggregation and charting, cron works fine. But with Cowork, you can pass your aggregated results directly to Claude and ask it to explain "what changed compared to last week" and "possible causes for anomalies" in plain language — then inject that analysis into the top of your report. No extra infrastructure required.

The other advantage is access to your local Mac environment. Since Cowork runs as a desktop app, it can read local CSV files, access files on network drives, and interact with any tools installed on your machine — all without special configuration.

Here's the pipeline we'll build:

  1. Fetch data from local CSVs or Google Sheets via Python
  2. Aggregate and preprocess with pandas
  3. Generate charts with Matplotlib (PNG output)
  4. Let Claude AI analyze week-over-week changes and write a commentary
  5. Save as a Markdown report and send a Slack notification
  6. Run automatically every Monday morning via Cowork's scheduled tasks

Step 1: Set Up the Python Environment in Cowork

Cowork has direct access to your Mac's shell environment. Start by checking what's available and installing any missing libraries.

Open a new Cowork conversation and prompt:

Check my bash environment. Show me python3 --version, pip3 --version,
and whether pandas, matplotlib, and openpyxl are installed.

Claude will run something like:

# Check Python environment
python3 --version
pip3 --version
 
# Check required libraries
python3 -c "import pandas; print('pandas:', pandas.__version__)" 2>/dev/null || echo "pandas: NOT INSTALLED"
python3 -c "import matplotlib; print('matplotlib:', matplotlib.__version__)" 2>/dev/null || echo "matplotlib: NOT INSTALLED"
python3 -c "import openpyxl; print('openpyxl:', openpyxl.__version__)" 2>/dev/null || echo "openpyxl: NOT INSTALLED"

If anything's missing, just tell Claude: "Please install the missing libraries." It will run pip3 install pandas matplotlib openpyxl for you.

Creating a Virtual Environment (Optional)

For a project-specific environment, prompt:

Create a virtual environment at ~/data-analysis-automation and install
pandas, matplotlib, openpyxl, requests, and slack-sdk.

Claude will execute:

# Create project directory and virtual environment
mkdir -p ~/data-analysis-automation
cd ~/data-analysis-automation
python3 -m venv .venv
 
# Install libraries
.venv/bin/pip install pandas matplotlib openpyxl requests slack-sdk gspread google-auth
 
# Generate requirements.txt for reproducibility
.venv/bin/pip freeze > requirements.txt
echo "✅ Environment ready"
✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦If you've been manually summarizing spreadsheets, you'll learn how to set up Cowork's scheduled tasks to auto-generate weekly reports every Monday morning
✦Get complete, copy-paste-ready pipeline code combining pandas, Matplotlib, and Google Sheets API — no stub code, everything runs
✦Learn production-ready patterns including error handling, logging, and Slack notifications so your automation keeps running reliably
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

◈ Cowork2026-09-16
The scheduled task that only ran on days my desk was awake
Cowork scheduled tasks run remotely by default, but the moment one needs a local file or app, it runs only on your machine. Here is how the last field in the setup dialog decides that, and the three questions I now answer before creating a task.
◈ Cowork2026-09-08
Until I planted a failing sample, my unattended checks had never once failed
A check running on an unattended schedule lost its exit code to a single pipe added for readable logs. I measured where the status disappears and built a small harness that checks the checker.
◈ Cowork2026-08-23
Not Every Unreachable Connector Means the Same Thing in an Unattended Run
When an unattended task cannot reach a connector, the cause splits into three states: still connecting, unauthenticated, or genuinely absent. Each demands the opposite response. Here is the resolver that tells them apart.