CLAUDE LABJP
MCP — The July 28 MCP spec release candidate drops the Mcp-Session-Id header and goes stateless, so remote MCP servers no longer need sticky sessionsAPPS — The same release adds MCP Apps for server-rendered UI and a Tasks extension for long-running workMEMORY — The Python 0.116.0, TypeScript 0.110.0, and Go 1.56.0 SDKs now send agent-memory-2026-07-22 on every memory store callSPILL — Output from agent_toolset and MCP tools past 100K characters now spills to a file in the sandbox, with the model receiving a truncated preview it can expandBG — MCP tool calls running past two minutes move to the background automatically, keeping the session usable; tune it with CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSRESUME — Typing /resume in the agent view opens a picker of past sessions and brings your pick back as a background sessionMCP — The July 28 MCP spec release candidate drops the Mcp-Session-Id header and goes stateless, so remote MCP servers no longer need sticky sessionsAPPS — The same release adds MCP Apps for server-rendered UI and a Tasks extension for long-running workMEMORY — The Python 0.116.0, TypeScript 0.110.0, and Go 1.56.0 SDKs now send agent-memory-2026-07-22 on every memory store callSPILL — Output from agent_toolset and MCP tools past 100K characters now spills to a file in the sandbox, with the model receiving a truncated preview it can expandBG — MCP tool calls running past two minutes move to the background automatically, keeping the session usable; tune it with CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSRESUME — Typing /resume in the agent view opens a picker of past sessions and brings your pick back as a background session
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.

cowork13python22data analysisautomation97pandas2matplotlibscheduled tasks8report 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-07-17
It Worked on My Machine, but Nobody Could Trigger It — Four Assumptions I Stripped Out of a Cowork Plugin
I bundled four working automation skills into a plugin and shared it. Only one of them ever fired. Here is how I measured skill trigger rate, and the four assumptions — vocabulary, paths, connections, and naming — I had to strip out before it was portable.
Cowork2026-07-05
When Claude Declines a Request on Safety Grounds, What Should an Unattended Pipeline Return?
A third kind of ending that is neither an error nor a normal completion — a safety decline. Here is how to fold it into a pipeline you run unattended, with a classifier and a review-queue design drawn from indie development.
Cowork2026-06-27
Logged as success, but it produced nothing — stopping silent failures in Cowork scheduled tasks with end-of-run assertions
A Cowork scheduled task exits 0, yet not a single artifact was produced. Trusting the exit code alone hides this silent failure. Here is how to turn your definition of done into end-of-run assertions that fail loudly with an evidence log.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →