tutorialintermediate
Claude Skills for financial applications Oct 2025 • Skills Build financial dashboards and portfolio analytics using Claude's Excel, PowerPoint, PDF skills.
cookbook
View original on cookbookThis cookbook teaches how to build financial dashboards, portfolio analytics, and automated reporting workflows using Claude's Excel, PowerPoint, and PDF skills. It covers three main use cases: creating comprehensive financial models with formulas and charts in Excel, generating executive presentations from financial data, and automating multi-format reporting pipelines. The guide includes setup instructions, data loading examples, and helper functions for working with the Anthropic SDK to create professional financial documents directly through Claude's interface.
Key Points
- •Set up Claude Skills environment with Anthropic SDK v0.69.0+, configure API key, and verify file creation/download capabilities
- •Load financial data from multiple sources (CSV for statements, JSON for portfolio holdings and quarterly metrics) into pandas DataFrames for manipulation
- •Use Claude's Excel skill to create multi-sheet financial dashboards with formulas, formatting, and charts automatically generated
- •Leverage PowerPoint skill to generate executive presentations directly from financial data with professional formatting
- •Build portfolio analysis tools that calculate risk metrics, performance analytics, and investment committee decks
- •Implement automated reporting pipelines that combine Excel, PowerPoint, and PDF skills for end-to-end document generation
- •Use helper functions like `create_skills_message()` to streamline API calls with skills and handle file downloads
- •Format financial values consistently using utility functions for currency, percentages, and numerical displays
- •Extract and transform raw financial data (revenue, margins, returns) into structured formats for dashboard visualization
- •Implement code execution alongside skills to enable dynamic calculations and data processing within Claude's workflow
Found this useful? Add it to a playbook for a step-by-step implementation guide.
Workflow Diagram
Start Process
Step A
Step B
Step C
Complete
Concepts
Artifacts (3)
Financial Dashboard Setuppythonscript
# Standard imports
import json
import os
import sys
from pathlib import Path
import pandas as pd
# Add parent directory for imports
sys.path.insert(0, str(Path.cwd().parent))
# Anthropic SDK
from anthropic import Anthropic
from dotenv import load_dotenv
# Our utilities
from file_utils import (
download_all_files,
print_download_summary,
)
# Load environment
load_dotenv(Path.cwd().parent / ".env")
# Configuration
API_KEY = os.getenv("ANTHROPIC_API_KEY")
MODEL = "claude-sonnet-4-6"
if not API_KEY:
raise ValueError("ANTHROPIC_API_KEY not found. Please configure your .env file.")
# Initialize client
client = Anthropic(api_key=API_KEY)
# Setup directories
OUTPUT_DIR = Path.cwd().parent / "outputs" / "financial"
OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
DATA_DIR = Path.cwd().parent / "sample_data"
print("✓ Environment configured")
print(f"✓ Output directory: {OUTPUT_DIR}")
print(f"✓ Data directory: {DATA_DIR}")Skills Message Helper Functionpythonscript
def create_skills_message(client, prompt, skills, prefix="", show_token_usage=True):
"""
Helper function to create messages with Skills.
Args:
client: Anthropic client
prompt: User prompt
skills: List of skill dicts [{"type": "anthropic", "skill_id": "xlsx", "version": "latest"}]
prefix: Prefix for downloaded files
show_token_usage: Whether to print token usage
Returns:
Tuple of (response, download_results)
"""
response = client.beta.messages.create(
model=MODEL,
max_tokens=4096,
container={"skills": skills},
tools=[{"type": "code_execution_20250825", "name": "code_execution"}],
messages=[{"role": "user", "content": prompt}],
betas=[
"code-execution-2025-08-25",
"files-api-2025-04-14",
"skills-2025-10-02",
],
)
if show_token_usage:
print(f"\n📊 Token Usage: {response.usage.input_tokens} in, {response.usage.output_tokens} out")
# Download files
results = download_all_files(client, response, output_dir=str(OUTPUT_DIR), prefix=prefix)
return response, results
def format_financial_value(value, is_currency=True, decimals=0):
"""Format financial values for display."""
if is_currency:
return f"${value:,.{decimals}f}"
else:
return f"{value:,.{decimals}f}"
print("✓ Helper functions defined")Load Financial Datapythonscript
# Load financial statements
financial_statements = pd.read_csv(DATA_DIR / "financial_statements.csv")
print("📊 Financial Statements Overview:")
print(f" Shape: {financial_statements.shape}")
print(f" Categories: {len(financial_statements['Category'].unique())} financial metrics")
print(f" Quarters: {list(financial_statements.columns[1:5])}")
print()
# Load portfolio holdings
with open(DATA_DIR / "portfolio_holdings.json") as f:
portfolio_data = json.load(f)
print("💼 Portfolio Overview:")
print(f" Portfolio: {portfolio_data['portfolio_name']}")
print(f" Total Value: ${portfolio_data['total_value']:,.2f}")
print(f" Holdings: {len(portfolio_data['holdings'])} stocks")
print(f" Cash Position: ${portfolio_data['cash_position']['amount']:,.2f}")
print(f" Total Return: {portfolio_data['performance_metrics']['total_return_percent']:.1f}%")
print()
# Convert holdings to DataFrame
portfolio_df = pd.DataFrame(portfolio_data["holdings"])
print("Top 5 holdings by value:")
print(portfolio_df.nlargest(5, "market_value")[["ticker", "name", "market_value", "unrealized_gain"]])
# Load quarterly metrics
with open(DATA_DIR / "quarterly_metrics.json") as f:
quarterly_metrics = json.load(f)
print("📈 Quarterly Metrics Overview:")
print(f" Quarters available: {len(quarterly_metrics['quarters'])}")
print(f" Metrics per quarter: {len(quarterly_metrics['quarters'][0])} KPIs")